mirror of
https://github.com/php/php-src.git
synced 2026-04-18 05:21:02 +02:00
The string held by the zend_type may be released if the property type gets resolved to a CE. I initially wanted to fix this by storing a zend_type* instead (so the property type resolution propagates to the ReflectionType), but decided against this in light of upcoming union types support, where we also need to represent parts of the union, and will not have a single zend_type* we can reference.
23 lines
373 B
PHP
23 lines
373 B
PHP
--TEST--
|
|
Bug #78774: ReflectionNamedType on Typed Properties Crash
|
|
--FILE--
|
|
<?php
|
|
|
|
class Test {
|
|
public stdClass $prop;
|
|
}
|
|
|
|
$rc = new ReflectionClass(Test::class);
|
|
$rp = $rc->getProperty('prop');
|
|
$rt = $rp->getType();
|
|
|
|
// Force a resolution of the property type
|
|
$test = new Test;
|
|
$test->prop = new stdClass;
|
|
|
|
var_dump($rt->getName());
|
|
|
|
?>
|
|
--EXPECT--
|
|
string(8) "stdClass"
|