Repository navigation
Conversation
… member by member, and print_r or var_export with a literal true as the string it returns (#950)
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.
Slice S2 of the type/arity reproduction run (#1051). Part of #950:
return f(args)is now judged the way$x = f(args); return $x;is, and a finite set of candidate values (OneOf) is judged per member (decision D6).What changed
return_call.rs(new), for R6: a returned call is bound into a copy of the env and store byapply_assign, gets the statement's own summary and arms, and the return seam judges that slot. The value as written is still tried first, so no base finding is lost.finite_verdict.rs(new), for R5: a OneOf is judged member by member throughis_type_error, in the file's own mode. A null member is admitted for?T, for an implicit-null default, and under the coercive internal-null carve-out.type.argument-mismatch/type.return-mismatchreturn_maybe.rs/arg_check.rs: a OneOf is no longer declined on a variable or a summary carrier.builtin_returns.rs: a literaltrueas$returnnarrows the floor tostringforprint_r,var_export,highlight_stringandhighlight_file, at the return, assign and argument seams. Without this, the A/B showedreturn var_export($x, true)as a false positive.Tests
return_call_oneof.rshas 26 tests, one per table row. 14 fail on base.this_exactnessnow reports the possibly grade. One maybe-return test is rewritten as a parity test.Measurement (ten public packages)
return builtin()orreturn $this->m(). Each has a PHP strict witness:preg_replacereturns null on a backtrack-limit error (5 findings).realpath,array_search,key,abs,array_sumandoctdecreturn types that the declared return does not admit (7 findings).?intor?stringcallee returns null into a non-null return (2 findings).--no-php: identical.ADR
ADR-0043 has a 2026-10-11 amendment (PENDING).
Not covered
$returnnarrowing covers four builtins only.