Skip to content

Regression: var_export() mangled array keys with NUL bytes (#13875) - #13878

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-13875-var-export-mangled-keys
Jun 30, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-13875-var-export-mangled-keys

Conversation

@PurHur

@PurHur PurHur commented Jun 30, 2026

Copy link
Copy Markdown
Owner

Summary

Closes #13875

Test plan

./script/docker-exec.sh -- php test/repro/maintainer_gap_var_export_mangled_array_keys.php
# ok

./script/docker-exec.sh -- php bin/vm.php test/repro/maintainer_gap_var_export_mangled_array_keys.php
# ok

# Zend/VM output match:
# array (
#   '' . "\0" . '*' . "\0" . 'w' => 1,
#   '' . "\0" . 'C' . "\0" . 'p' => 2,
# )

./script/docker-exec.sh -- bash -lc 'cd /compiler && vendor/bin/phpunit test/compliance/VarExportVMTest.php test/compliance/VarExportJITTest.php'
# OK (4 tests)

./script/docker-exec.sh -- bash -lc 'cd /compiler && php bin/compile.php -l test/repro/maintainer_gap_var_export_mangled_array_keys.php'
# AOT lint OK

Made with Cursor

…13875).

Match ext/standard/var.c php_array_element_export: addcslashes then
emit '' . "\0" . ' segments for mangled property keys from
get_mangled_object_vars().

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit a173a17 into master Jun 30, 2026
@PurHur
PurHur deleted the agent/issue-13875-var-export-mangled-keys branch June 30, 2026 00:51
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.

Regression: var_export() array keys with NUL bytes — stripped labels not php-src concatenation (ext/standard/var.c)

1 participant