/
vshmidt
/
php
Обзор
Документация
Войти
/
vshmidt
/
php
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
ext/spl/tests/SplFileObject/SplFileObject_getCurrentLine_invalid_override.phpt
22 строки
469 B
George Peter Banyard
Move SplFileObject tests into subfolder
27 май 2022, 20:33
27 май 2022, 20:33
fc799ec
Код
Авторство
О чём код?
--TEST-- Invalid SplFileObject::getCurrentLine() return type --FILE-- <?php class MySplFileObject extends SplFileObject { #[ReturnTypeWillChange] public function getCurrentLine(): array { return [1, 2, 3]; } } $obj = new MySplFileObject(__FILE__); try { var_dump($obj->current()); } catch (TypeError $e) { echo $e->getMessage(), "\n"; } ?> --EXPECT-- MySplFileObject::getCurrentLine(): Return value must be of type string, array returned