1--TEST-- 2Invalid SplFileObject::getCurrentLine() return type 3--FILE-- 4<?php 5 6class MySplFileObject extends SplFileObject { 7 #[ReturnTypeWillChange] 8 public function getCurrentLine(): array { 9 return [1, 2, 3]; 10 } 11} 12 13$obj = new MySplFileObject(__FILE__); 14try { 15 var_dump($obj->current()); 16} catch (TypeError $e) { 17 echo $e->getMessage(), "\n"; 18} 19 20?> 21--EXPECT-- 22MySplFileObject::getCurrentLine(): Return value must be of type string, array returned 23