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
PHP 8 attributes compile and read via ReflectionClass::getAttributes() + ReflectionAttribute::getName() (#1936 ✅). Zend also supports ReflectionAttribute::newInstance() to construct the attribute class with constructor args from the declaration. Frameworks (DI, routing, validation) depend on newInstance() — without it, attributes are names-only metadata.
#2467 tracks JIT/AOT reflection tables; this issue is the VM semantic for newInstance().
Category
language|stdlibProblem
PHP 8 attributes compile and read via
ReflectionClass::getAttributes()+ReflectionAttribute::getName()(#1936 ✅). Zend also supportsReflectionAttribute::newInstance()to construct the attribute class with constructor args from the declaration. Frameworks (DI, routing, validation) depend onnewInstance()— without it, attributes are names-only metadata.#2467 tracks JIT/AOT reflection tables; this issue is the VM semantic for
newInstance().php-src reference
ext/reflection/php_reflection.c—reflection_attribute_get_instanceZend/zend_attributes.c— stored attribute args +zend_attribute_get_new_instanceRepro (failure today)
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php bin/vm.php repro.php'Zend PHP:
/homeThis compiler: fatal (method missing) or wrong behavior
Scope (this repo)
ClassEntry/ method metadata (from php-cfgattrGroups)lib/VM/Builtin/ReflectionAttributeGetName.php→ addnewInstancemethodlib/VM/BuiltinClasses.php— registerReflectionAttribute::newInstancenewwith compile-time constant args v1; reject dynamic args with clear errortest/compliance/cases/language/attribute_new_instance.phptDone when
/homeon VMnewInstance()returns new object instances (Zend semantics)ReflectionExceptionmatching Zend wording./script/ci-fast.sh --filter attribute_new_instancegreenRelated
lib/sources