Skip to content

Stdlib: number_format() reject dec_point:/thousands_sep: named aliases (#10132) - #10138

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-10132-number-format-named-params
Jun 19, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-10132-number-format-named-params

Conversation

@PurHur

@PurHur PurHur commented Jun 19, 2026

Copy link
Copy Markdown
Owner

Summary

  • Remove incorrect dec_point / thousands_sep named-parameter aliases from BuiltinParamNames::aliasesForFunction() for number_format().
  • Zend/php-src only accepts decimal_separator / thousands_separator; wrong names must throw Error: Unknown named parameter.
  • Update compliance + unit tests to assert rejection instead of silent default separators.

php-src reference: ext/standard/number_format.c, ext/standard/basic_functions.stub.php

Verification

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php bin/vm.php test/repro/issue_number_format_dec_point_named.php 2>&1 || true
# PHP Fatal error: Unknown named parameter $dec_point

php bin/vm.php test/repro/issue_number_format_named.php
# '1.23' / '1 235' (canonical names still work)

vendor/bin/phpunit --filter number_format_dec_point_named
# OK (4 tests)

vendor/bin/phpunit --filter number_format_named_params
# OK (4 VM/JIT tests; pre-existing AOT fixture failure on master)

php bin/compile.php -l test/repro/issue_number_format_dec_point_named.php
php bin/compile.php -l test/repro/issue_number_format_named.php
# both exit 0

Closes #10132

Made with Cursor

Remove incorrect PHP 8.4 alias table entries so unknown named parameters
match Zend (Error) instead of silently using default separators.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stdlib: number_format() dec_point: named parameter — unknown name must Error not silently use defaults (ext/standard/number_format.c)

1 participant