You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ReflectionClass of ArrayObject, SplObjectStorage and DateTimeImmutable throws "does not exist", and Exception lists internal properties instead of php's #295
ReflectionClass of ArrayObject, SplObjectStorage and DateTimeImmutable throws "does not exist", and Exception lists internal properties instead of php's.
ArrayObject:
[exit code 255]
PHP Fatal error: Uncaught ReflectionException: Class "ArrayObject" does not exist
Tracking
Known-bug repro: tests/aot/repro/wrong/refl_prelude_classes_not_reflectable.php — bash tests/aot/xfail.sh -k refl_prelude_classes_not_reflectable reports XFAIL while this is open and XPASS once it is fixed; then move the repro into tests/aot/cases/ and close this issue.
Found while fixing the symfony-app dev boot (#287–#290, merged in #294). Symfony\Polyfill\DeepClone::getHydrator() takes its "internal class" branch for prelude classes (ReflectionClass::isInternal() is true) and sets properties through ReflectionProperty::setValue(...). A deepclone_to_array / deepclone_from_array round-trip of an object graph that holds new ArrayObject([1]) or new DateTimeImmutable(...) still fails natively with Uncaught ReflectionException: Cannot write property ts; Zend round-trips it. A RuntimeException with a previous exception round-trips.
State
ReflectionClass('ArrayObject' | 'SplObjectStorage' | 'DateTimeImmutable') throws Class "…" does not exist (these prelude classes carry no reflection table).
The prelude ArrayObject::__construct declares only $array; php has $array, $flags, $iteratorClass (so (string)$param of internal constructors differs too: quoting '' vs "", NULL vs null, hints mixed vs object|array).
Direction
Emit reflection tables (properties with accessors, methods, parameters) for the prelude classes frameworks introspect, keep implementation-only fields out of getProperties(), and make the prelude signatures match php's arity.
Activity
blacktrs commentedon Oct 16, 2026
Impact
Found while fixing the
symfony-appdev boot (#287–#290, merged in #294).Symfony\Polyfill\DeepClone::getHydrator()takes its "internal class" branch for prelude classes (ReflectionClass::isInternal()is true) and sets properties throughReflectionProperty::setValue(...). Adeepclone_to_array/deepclone_from_arrayround-trip of an object graph that holdsnew ArrayObject([1])ornew DateTimeImmutable(...)still fails natively withUncaught ReflectionException: Cannot write property ts; Zend round-trips it. ARuntimeExceptionwith a previous exception round-trips.State
ReflectionClass('ArrayObject' | 'SplObjectStorage' | 'DateTimeImmutable')throwsClass "…" does not exist(these prelude classes carry no reflection table).ExceptionreportstraceNames/traceLines(internal fields) and nostringproperty; php reportsmessage, string, code, file, line, trace, previous. Since ReflectionProperty::setValue() on a property of a prelude class (Exception::$message, ::$code) throws "Cannot write property" #289 the real properties have accessors, sosetValue()works on them.ArrayObject::__constructdeclares only$array; php has$array,$flags,$iteratorClass(so(string)$paramof internal constructors differs too: quoting''vs"",NULLvsnull, hintsmixedvsobject|array).Direction
Emit reflection tables (properties with accessors, methods, parameters) for the prelude classes frameworks introspect, keep implementation-only fields out of
getProperties(), and make the prelude signatures match php's arity.