Category
stdlib · php-src-strict · ext/intl
Problem
On unparseable input, Zend NumberFormatter::parse() returns false, sets the formatter error to U_PARSE_ERROR (code 9) with message Number parsing failed: U_PARSE_ERROR, and leaves the global intl_get_error_code() at 0. This compiler returns false but uses code 1 (U_ILLEGAL_ARGUMENT_ERROR-shaped), prefixes the message with numfmt_parse:, and also writes the failure into the global intl error (code 1).
Probed 2026-07-24 — Zend 8.2.32 vs php bin/vm.php.
| Repro |
Zend 8.2+ |
VM (2026-07-24) |
parse('not-a-number') |
false |
false |
$f->getErrorCode() |
9 (U_PARSE_ERROR) |
1 |
$f->getErrorMessage() |
Number parsing failed: U_PARSE_ERROR |
numfmt_parse: Number parsing failed: U_PARSE_ERROR |
intl_get_error_code() after |
0 |
1 |
php-src reference
PHP implementation target
ext/intl NumberFormatter parse path (PHP) — map ICU parse failure to code 9 / message without changing Zend’s global-intl non-pollution for this API
- Expose/recognize
U_PARSE_ERROR consistently with other intl status constants
- No new C
Repro
./script/docker-exec.sh -- bash -lc 'cat > /tmp/nf_parse_err.php <<"PHP"
<?php
$f = new NumberFormatter("en_US", NumberFormatter::DECIMAL);
$r = $f->parse("not-a-number");
var_export($r); echo "\n";
echo $f->getErrorCode(), "\n";
echo $f->getErrorMessage(), "\n";
echo intl_get_error_code(), "\n";
PHP
php /tmp/nf_parse_err.php; php bin/vm.php /tmp/nf_parse_err.php'
Done when
Maintainer note (2026-07-24)
Pillar 1 red (north-star5-fast 4f-m). Live probe vs Zend 8.2.32.
Category
stdlib· php-src-strict · ext/intlProblem
On unparseable input, Zend
NumberFormatter::parse()returnsfalse, sets the formatter error toU_PARSE_ERROR(code9) with messageNumber parsing failed: U_PARSE_ERROR, and leaves the globalintl_get_error_code()at0. This compiler returnsfalsebut uses code1(U_ILLEGAL_ARGUMENT_ERROR-shaped), prefixes the message withnumfmt_parse:, and also writes the failure into the global intl error (code1).Probed 2026-07-24 — Zend 8.2.32 vs
php bin/vm.php.parse('not-a-number')falsefalse$f->getErrorCode()9(U_PARSE_ERROR)1$f->getErrorMessage()Number parsing failed: U_PARSE_ERRORnumfmt_parse: Number parsing failed: U_PARSE_ERRORintl_get_error_code()after01php-src reference
ext/intl/formatter/formatter_main.c/formatter_format.c— parse error statusU_PARSE_ERROR= 9PHP implementation target
ext/intlNumberFormatter parse path (PHP) — map ICU parse failure to code9/ message without changing Zend’s global-intl non-pollution for this APIU_PARSE_ERRORconsistently with other intl status constantsRepro
Done when
9+ Zend message text (nonumfmt_parse:prefix drift)intl_get_error_code()remains0after failed parse (Zend match).phptundertest/compliance/cases/Maintainer note (2026-07-24)
Pillar 1 red (
north-star5-fast4f-m). Live probe vs Zend 8.2.32.