Stdlib: in_array/array_search null $strict TypeError under strict_types (#29866) - #30074
Merged
Conversation
…es (#29866) Reuse Z_PARAM_BOOL guards (VmMath::parseBoolBuiltinArgForFrame / JitBoolArg::lowerCoerceZParamBool) so null $strict matches php-src under strict_types and soft-DEP+coerces without it. Co-authored-by: Cursor <cursoragent@cursor.com>
4 tasks
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
in_array/array_searchArgument Stdlib: ceil, floor, intval and expanded PHPT specs #3 ($strict) null handling to match php-srcZ_PARAM_BOOL: TypeError understrict_types=1, Deprecated+coerce otherwise.VmMath::parseBoolBuiltinArgForFrame; JIT/AOT usesJitBoolArg::lowerCoerceZParamBool(+ compile-time null early TypeError, peer substr_compare Regression: substr_compare(..., null) $case_insensitive coerces — Zend TypeError (ext/standard/string.c) #29756).ext/standard/array.c/array.stub.php.Closes #29866
Test plan
PHP_COMPILER_PROFILE=8.4 php bin/vm.php test/repro/issue_29866_in_array_strict_null.php→ TypeError both callsphp bin/jit.phpsame repro → TypeError./phpc build -o /tmp/ia29866 test/repro/issue_29866_in_array_strict_null.php && /tmp/ia29866→ TypeError$strictwithout strict_types → DEP + coerce (true/0)./script/phpunit.sh --filter InArrayArraySearchStrictNull→ OK (3)./script/phpunit.sh --filter in_array_array_search_strict_null→ OK (4, includes AotTest)Pillar probe (pre-implement)
bootstrap-inventory --check: docs method-count drift only (not spine)release-readiness --json:north-star5-fastok;user_release_ready: nodue to pre-existing helper-runtime prelink stale (Urlencode/Utf8Latin1) — untouched by this PRMade with Cursor