Closes GH-6428.
. Fixed bug #74558 (Can't rebind closure returned by Closure::fromCallable()).
(cmb)
+- Reflection:
+ . Fixed bug #80370 (getAttributes segfault on dynamic properties). (Benjamin
+ Eberlei)
+
12 Nov 2020, PHP 8.0.0RC4
- Core:
GET_REFLECTION_OBJECT_PTR(ref);
+ if (ref->prop == NULL) {
+ RETURN_EMPTY_ARRAY();
+ }
+
reflect_attributes(INTERNAL_FUNCTION_PARAM_PASSTHRU,
ref->prop->attributes, 0, ref->prop->ce, ZEND_ATTRIBUTE_TARGET_PROPERTY,
ref->prop->ce->type == ZEND_USER_CLASS ? ref->prop->ce->info.user.filename : NULL);
--- /dev/null
+--TEST--
+Bug #80370: Segfault on ReflectionProperty::getAttributes of dynamic property
+--FILE--
+<?php
+class Foobar {
+
+}
+
+$foobar = new Foobar();
+$foobar->bar = 42;
+
+$reflectionObject = new ReflectionObject($foobar);
+$reflectionProperty = $reflectionObject->getProperty('bar');
+var_dump($reflectionProperty->getAttributes());
+--EXPECT--
+array(0) {
+}