Summary
Passing a backed enum case to chr() must throw TypeError (Zend 8.2). VM currently hits Undefined constant PHPCompiler\VM\Variable::TYPE_RESOURCE in VmMath::vmTypeName() because TYPE_ENUM_CASE is not handled in parseChrCodepoint() / parseLongBuiltinArgCore().
Umbrella #5524 tracks string builtins generally; this is a hard VM fatal on a common path and should be fixed in VmMath + chr/ord callers.
php-src reference
ext/standard/string.c — PHP_FUNCTION(chr)
PHP implementation
ext/standard/VmMath.php — vmTypeName() + early TYPE_ENUM_CASE → TypeError in parseChrCodepoint()
ext/standard/chr.php (VM + JIT via JitChr)
Repro
php test/repro-maintainer/parity_chr_enum_operand.php
php bin/vm.php test/repro-maintainer/parity_chr_enum_operand.php
Acceptance
- VM emits Zend-parity
TypeError: chr(): Argument #1 ($codepoint) must be of type int, E given (enum class name in message).
- Compliance or unit test under
test/compliance/cases/stdlib/.
Summary
Passing a backed enum case to
chr()must throw TypeError (Zend 8.2). VM currently hitsUndefined constant PHPCompiler\VM\Variable::TYPE_RESOURCEinVmMath::vmTypeName()becauseTYPE_ENUM_CASEis not handled inparseChrCodepoint()/parseLongBuiltinArgCore().Umbrella #5524 tracks string builtins generally; this is a hard VM fatal on a common path and should be fixed in
VmMath+chr/ordcallers.php-src reference
ext/standard/string.c—PHP_FUNCTION(chr)PHP implementation
ext/standard/VmMath.php—vmTypeName()+ earlyTYPE_ENUM_CASE→ TypeError inparseChrCodepoint()ext/standard/chr.php(VM + JIT viaJitChr)Repro
Acceptance
TypeError: chr(): Argument #1 ($codepoint) must be of type int, E given(enum class name in message).test/compliance/cases/stdlib/.