1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
--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"
|