Category
stdlib · php-src-strict
Problem
#4163 tracks number_format() rejecting array operands. Enum case operands are a separate gap: VM accepts backed enum cases (coercing or formatting via backing) while Zend throws TypeError because $num must be int|float, not an enum object.
php-src reference
PHP implementation target: ext/standard/number_format.php, ext/standard/JitNumberFormat.php — reject TYPE_ENUM_CASE before numeric coercion (same guard pattern as #5613 math batch).
Repro
test/repro-maintainer/parity_number_format_enum_operand.php:
docker info >/dev/null
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php test/repro-maintainer/parity_number_format_enum_operand.php
php bin/vm.php test/repro-maintainer/parity_number_format_enum_operand.php'
| Runtime |
Output |
| Zend PHP 8.2 |
TypeError: number_format(): Argument #1 ($num) must be of type float, E given |
bin/vm.php |
number_format: NO_ERROR (silent wrong path) |
Done when
Related
Category
stdlib· php-src-strictProblem
#4163 tracks
number_format()rejecting array operands. Enum case operands are a separate gap: VM accepts backed enum cases (coercing or formatting via backing) while Zend throwsTypeErrorbecause$nummust beint|float, not an enum object.php-src reference
ext/standard/number_format.c—php_number_format()Z_PARAM_NUMBER / float-only$numPHP implementation target:
ext/standard/number_format.php,ext/standard/JitNumberFormat.php— rejectTYPE_ENUM_CASEbefore numeric coercion (same guard pattern as #5613 math batch).Repro
test/repro-maintainer/parity_number_format_enum_operand.php:TypeError: number_format(): Argument #1 ($num) must be of type float, E givenbin/vm.phpnumber_format: NO_ERROR(silent wrong path)Done when
$numthrowsTypeErroron VM/JIT/AOTtest/compliance/cases/stdlib/number_format_enum_type_error.phptRelated
$numTypeError