/
vshmidt
/
php
Обзор
Документация
Войти
/
vshmidt
/
php
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
ext/reflection/tests/internal_parameter_default_value/ReflectionParameter_getDefaultValue_Internal.phpt
37 строк
908 B
Máté Kocsis
Store default parameter values of internal functions in arg info
08 апр 2020, 19:37
Не верифицирован
08 апр 2020, 19:37
3709e74
Код
Авторство
О чём код?
--TEST-- ReflectionParameter::getDefaultValue() should also work for parameters of internal functions. --FILE-- <?php $class = new ReflectionClass('DateTime'); $method = $class->getMethod('setTime'); foreach ($method->getParameters() as $k => $parameter) { try { var_dump($parameter->getDefaultValue()); } catch (ReflectionException $exception) { echo $exception->getMessage() . "\n"; } } echo "----------\n"; $class = new ReflectionClass('DateTimeZone'); $method = $class->getMethod('listIdentifiers'); foreach ($method->getParameters() as $parameter) { try { var_dump($parameter->getDefaultValue()); } catch (ReflectionException $exception) { echo $exception->getMessage() . "\n"; } } ?> --EXPECT-- Internal error: Failed to retrieve the default value Internal error: Failed to retrieve the default value int(0) int(0) ---------- int(2047) NULL