1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00
Files
archived-php-src/ext/reflection/tests/bug81208.phpt
Nikita Popov b976bc44f1 Fixed bug #81208
The number of populated positional arguments is argc. i may also
include named args and thus try to dtor uninitialized zvals.
2021-07-01 13:36:57 +02:00

29 lines
617 B
PHP

--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"