/
vshmidt
/
php
Обзор
Документация
Войти
/
vshmidt
/
php
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
ext/reflection/tests/ReflectionClass_getConstant_error.phpt
25 строк
852 B
Daniel Scherzer
[RFC] Deprecate ReflectionClass::getConstant() for missing constants (#19456)
12 авг 2025, 15:50
Не верифицирован
12 авг 2025, 15:50
ffdc104
Код
Авторство
О чём код?
--TEST-- ReflectionClass::getConstant() - bad params --FILE-- <?php class C { const myConst = 1; } $rc = new ReflectionClass("C"); echo "Check invalid params:\n"; var_dump($rc->getConstant(1)); var_dump($rc->getConstant(1.5)); var_dump($rc->getConstant(true)); ?> --EXPECTF-- Check invalid params: 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) 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) 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)