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
Zend get_object_vars() on a backed enum case returns the pseudo-properties name and value (strings/scalars). This compiler rejects the call with TypeError because enum cases are still materialized as backing scalars in many paths (#8746).
Framework debug/dump code expects enum cases to behave like objects for introspection.
Category
stdlibProblem
Zend
get_object_vars()on a backed enum case returns the pseudo-propertiesnameandvalue(strings/scalars). This compiler rejects the call withTypeErrorbecause enum cases are still materialized as backing scalars in many paths (#8746).Framework debug/dump code expects enum cases to behave like objects for introspection.
php-src reference
ext/standard/var.c—PHP_FUNCTION(get_object_vars)Zend/zend_enum.c— enum case object propertiesRepro (failure today)
array ('name' => 'A', 'value' => 'x')TypeError: get_object_vars(): Argument #1 ($object) must be of type object, string givenScope (this repo)
ext/standard/get_object_vars.php+ enum object path inVmReflection/EnumCaseSupportTYPE_OBJECTor accepted enum wrapper (#8746)test/compliance/cases/stdlib/get_object_vars_enum_case.phptscript/capability-matrix.phpnote if VM-only initiallyDone when (php-src-strict)
var_exportmatches Zend for backed enums./script/ci-fast.sh --filter GetObjectVarsEnumgreenLogicExceptionfor user-facing TypeError mistakesRelated