Repository navigation
Stdlib: drop phantom $strict from array_find family (#23875) - #23913
Merged
Merged
Conversation
Match php-src stubs (exactly array+callback). Reject a 3rd argument with ArgumentCountError on VM/JIT/AOT; keep optional $strict only on forward-profile array_*_key helpers. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
$strictfromarray_find/array_find_key/array_any/array_allso Reflection and arity match php-src (ext/standard/basic_functions.stub.php/array.c).ArgumentCountError: … expects exactly 2 arguments, 3 givenon VM, JIT, and AOT (uncaught).array_all_key/array_any_keykeep optional$strict(Stdlib: array_all_key()/array_any_key() — PHP 8.4 $strict third parameter missing (ext/standard/array.c) #15704).array+callback(Stdlib: array_find()/array_find_key()/array_all()/array_any() — PHP 8.4 $strict third parameter missing (ext/standard/array.c) #6949 never shipped in php-src).Closes #23875
Test plan
PHP_COMPILER_PROFILE=8.4 php bin/vm.php test/repro/maintainer_gap_array_find_no_strict_84.php→okPHP_COMPILER_PROFILE=8.4 php -d memory_limit=1536M vendor/bin/phpunit --filter 'array_find_strict|array_find_named_params' test/compliance/VMTest.php→ 3 OKJITTest.php→ 3 OKPHP_COMPILER_PROFILE=8.4 php bin/compile.php -o /tmp/af_bad test/repro/maintainer_gap_array_find_arity_aot_84.php && /tmp/af_bad→ fatalArgumentCountError(exit 255)BuiltinParamNamesAliasTest::testArrayAllAnyNamedParameters→ OKci-fast/ spine (master spine red on unrelated soap include); multi-try AOT catch CFG for this family still flaky (uncaught path verified)Trust probe (this run)
user_release_ready: no(spine-coverage / north-star5-fast red on master — soap include)Made with Cursor