/
vshmidt
/
php
Обзор
Документация
Войти
/
vshmidt
/
php
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
ext/reflection/tests/ReflectionClass_toString_007.phpt
20 строк
386 B
Máté Kocsis
Typed class constants (#10444)
16 апр 2023, 23:20
Не верифицирован
16 апр 2023, 23:20
414f71a
Код
Авторство
О чём код?
--TEST-- Using ReflectionClass::__toString() with typed class constants when there is a type mismatch --FILE-- <?php class Foo { const array CONST1 = C; } define("C", new stdClass()); try { (string) new ReflectionClass(Foo::class); } catch (TypeError $e) { echo $e->getMessage() . "\n"; } ?> --EXPECT-- Cannot assign stdClass to class constant Foo::CONST1 of type array