/
vshmidt
/
php
Обзор
Документация
Войти
/
vshmidt
/
php
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
ext/reflection/tests/bug81208.phpt
28 строк
617 B
Nikita Popov
Fixed bug #81208
01 июл 2021, 14:36
01 июл 2021, 14:36
b976bc4
Код
Авторство
О чём код?
--TEST-- Bug #81208: Segmentation fault while create newInstance from attribute --FILE-- <?php #[Attribute(Attribute::TARGET_PROPERTY)] class MyAnnotation { public function __construct(public bool $nullable = false) {} } class MyClass { #[MyAnnotation(name: "my_name", type: "integer", nullable: asdasdasd)] public $property; } $z = new ReflectionClass(MyClass::class); foreach ($z->getProperty("property")->getAttributes() as $attribute) { try { $attribute->newInstance(); } catch (Error $e) { echo $e->getMessage(), "\n"; } } ?> --EXPECT-- Undefined constant "asdasdasd"