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
Regression vs closed #5462 / #3308: Backed enum E::cases() must be callable statically like Zend (zend_enum.c). VM throws Error: Non-static method E::cases() cannot be called statically, breaking array spread and any direct E::cases() use.
Category
language|stdlibProblem
Regression vs closed #5462 / #3308: Backed enum
E::cases()must be callable statically like Zend (zend_enum.c). VM throwsError: Non-static method E::cases() cannot be called statically, breakingarrayspread and any directE::cases()use.php-src reference
Zend/zend_enum.c—zend_enum_get_cases,cases()as static enum methodext/standard/basic_functions.c—gettype()on enum cases (pairs Language: gettype() JIT — enum case and boxed enum must return object (ext/standard/basic_functions.c) #5496)Repro
array( E::A, E::B )then spread of casesE::cases()cannot be called staticallyScope (this repo)
lib/VM.php— enum/static method resolution forcases()/from()/tryFrom()lib/Compiler.php— enum builtin method table if compile-timetest/compliance/cases/language/enum_cases_static.phpt, spread smokeDone when
cases()+ spread)./script/ci-fast.sh --filter enum_casesgreenVerification
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && ./script/ci-fast.sh --filter enum_cases'Related