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
bindec(), hexdec(), and octdec() accept backed enum cases as numeric-string operands via implicit coercion. Zend rejects them with TypeError via Z_PARAM_STR.
Distinct from #8782 (dechex()/decbin()/decoct() output coercion) — this issue covers input operands to base-decoding builtins.
Category
stdlib· php-src-strictProblem
bindec(),hexdec(), andoctdec()accept backed enum cases as numeric-string operands via implicit coercion. Zend rejects them withTypeErrorviaZ_PARAM_STR.Distinct from #8782 (
dechex()/decbin()/decoct()output coercion) — this issue covers input operands to base-decoding builtins.php-src reference
ext/standard/string.c—PHP_FUNCTION(bindec),hexdec,octdecRepro (verified 2026-06-16)
TypeErrorfor all threebindec ok,hexdec ok,octdec ok) ❌Scope (PHP-in-PHP)
ext/standard/bindec.php,hexdec.php,octdec.php—VmString::coerceStringBuiltinArg()test/compliance/cases/stdlib/bindec_hexdec_octdec_enum_typeerror.phptDone when
TypeErrormatching Zend for enum operands./script/ci-fast.sh --filter bindec_hexdec_enumgreenRelated