Skip to content

Stdlib: gate forward-profile builtins on 8.2 reference profile (#17206) - #17212

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-17206-forward-profile-builtin-gate
Jul 7, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-17206-forward-profile-builtin-gate

Conversation

@PurHur

@PurHur PurHur commented Jul 7, 2026

Copy link
Copy Markdown
Owner

Summary

  • Align supports* / advertises* gates in CompilerVersion for mb_trim, crc32c, class_uses_recursive, attribute_exists, and new hebrevc with the supportsJsonValidate reference-profile pattern so unset PHP_COMPILER_PROFILE matches Zend 8.2 function_exists parity.
  • Gate hebrevc registration in ext/standard/Module.php and BuiltinIntrospectionPolicy.
  • Add repro + compliance guard under test/compliance/cases/stdlib/profile_gate/.

php-src reference: ext/standard/basic_functions.c, ext/standard/crc32.c, ext/standard/string.c, ext/mbstring/mbstring.c.

Closes #17206

Verification

./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/maintainer_gap_forward_profile_builtin_leak_82.php'
# ok

./script/docker-exec.sh -- bash -lc 'php -r "var_dump(function_exists(\"mb_trim\"));"; php bin/vm.php -r "var_dump(function_exists(\"mb_trim\"));"'
# bool(false)
# bool(false)

./script/docker-exec.sh -- bash -lc 'PHP_COMPILER_PROFILE=8.4 php bin/vm.php test/repro/maintainer_gap_mb_trim_function_exists_forward_84.php'
# ok

./script/docker-exec.sh -- bash -lc 'PHP_COMPILER_PROFILE=8.4 php bin/vm.php test/repro/maintainer_gap_crc32c_builtin.php'
# ok

./script/docker-exec.sh -- bash -lc 'vendor/bin/phpunit test/unit/CompilerVersionBuiltinAdvertisementTest.php test/unit/CompilerVersionGateTest.php'
# OK (79 tests)

./script/docker-exec.sh -- bash -lc 'vendor/bin/phpunit test/compliance/VMTest.php --filter forward_profile_builtin_leak_82'
# OK (1 test)

Made with Cursor

Gate mb_trim, crc32c, hebrevc, attribute_exists, and class_uses_recursive
on CompilerVersion forward-profile predicates so unset PHP_COMPILER_PROFILE
matches Zend 8.2 function_exists parity; forward profile 8.4 keeps callability.

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.

Regression: forward-profile builtins register on 8.2 reference — mb_trim/crc32c/hebrevc leak (ext/standard/Module.php)

1 participant