/
vshmidt
/
php
Обзор
Документация
Войти
/
vshmidt
/
php
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
ext/reflection/tests/022.phpt
16 строк
401 B
Daniel Scherzer
[RFC] Deprecate ReflectionClass::getConstant() for missing constants (#19456)
12 авг 2025, 15:50
Не верифицирован
12 авг 2025, 15:50
ffdc104
Код
Авторство
О чём код?
--TEST-- ReflectionClass::getConstant --FILE-- <?php class Foo { const c1 = 1; } $class = new ReflectionClass("Foo"); var_dump($class->getConstant("c1")); var_dump($class->getConstant("c2")); ?> --EXPECTF-- int(1) Deprecated: ReflectionClass::getConstant() for a non-existent constant is deprecated, use ReflectionClass::hasConstant() to check if the constant exists in %s on line %d bool(false)