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
pack() forwards value operands through VmJson::export() in ext/standard/pack.php. Backed enum case arguments make the VM die with json_encode() value type not supported in this compiler build instead of matching Zend: E_WARNING (“Object of class E could not be converted to int”) and pack the backing scalar (pack('i', E::A) → 4-byte int 1).
Distinct from #4951 (hash() TypeError wording) and enum array coercion tickets.
Category
stdlibProblem
pack()forwards value operands throughVmJson::export()inext/standard/pack.php. Backed enum case arguments make the VM die withjson_encode() value type not supported in this compiler buildinstead of matching Zend: E_WARNING (“Object of class E could not be converted to int”) and pack the backing scalar (pack('i', E::A)→ 4-byte int1).Distinct from #4951 (
hash()TypeError wording) and enum array coercion tickets.php-src reference
ext/standard/pack.c—php_packargument coercionRepro
test/repro/parity_pack_backed_enum.php:len=4(32-bit int packing of1)VmJson::exportScope (PHP-in-PHP)
ext/standard/pack.phpBackedEnum::backingValuebefore packlib/AOT/runtime/phpc_pack.ctest/compliance/cases/stdlib/pack_backed_enum.phptDone when
pack('i', E::A)succeeds on VM with same byte length as Zend (little-endian host)TypeErroror warn per format — noVmJson::exportfatal./script/ci-fast.sh --filter pack_backed_enumgreenRelated