Skip to content

Language: ?? merge slot for array dim in func call args (#11603) - #15924

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-11603-localeconv-coalesce-call-arg
Jul 4, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-11603-localeconv-coalesce-call-arg

Conversation

@PurHur

@PurHur PurHur commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes #11603 — localeconv() fields looked NULL when read via $lc['decimal_point'] ?? null inside call arguments (e.g. var_export(..., true)).

Root cause: compiler call-arg wiring preferred the hoisted ArrayDimFetch producer slot over the stmt-level ?? merge slot when both preceded the same FuncCall. Direct offset access and echo paths were already correct.

Fix: final ARG_SEND pass in compileCallArgSends() prefers compileCallArgCoalesceSlot() when a stmt-level coalesce feeds the argument.

php-src reference: Zend/zend_compile.c null coalesce + call arg evaluation order.

PHP implementation: lib/Compiler.php (no C runtime changes).

Verification

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php bin/vm.php test/repro/maintainer_gap_localeconv_fields.php
php bin/vm.php test/compliance/cases/stdlib/localeconv_fields.phpt
php bin/vm.php test/compliance/cases/stdlib/var_export_return_true_coalesce.phpt
vendor/bin/phpunit --filter testNullCoalesceOperator'

Output (issue repro):

decimal='.'
thousands=''
currency=''

Compliance localeconv_fields.phpt also checks var_export($items['page'] ?? null, true) → 'home'.

Closes #11603

Made with Cursor

)

Stmt-level `$arr['key'] ?? null` inside call arguments (e.g. var_export)
was wired to the ArrayDimFetch producer slot instead of the coalesce merge
slot, so defined keys appeared as NULL. Final ARG_SEND pass now prefers the
?? result when present.

Co-authored-by: Cursor <cursoragent@cursor.com>
@cursor

cursor Bot commented Jul 4, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@PurHur
PurHur merged commit 5c072cc into master Jul 4, 2026
@PurHur
PurHur deleted the agent/issue-11603-localeconv-coalesce-call-arg branch July 4, 2026 07:06
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: localeconv() — decimal_point/thousands_sep/currency_symbol NULL not locale strings (ext/standard/locale.c)

1 participant