Test: differential sweep against Zend (#23354) - #23444
Merged
Merged
Conversation
The compliance suite asserts against recorded expectations, so it only catches what someone already thought to record. Nothing in the tree compared the compiler's output against Zend's on arbitrary programs, which is why #23354 — multi-argument calls handing every argument the trailing one's value — survived with no diagnostic: f($x + 1, $x + 2) printed "12 12" and str_replace($p['from'], $p['to'], 'xy!') returned "xy!", both running happily to completion. 24 of these 43 programs mismatched Zend on master when the corpus was written. All are fixed (#23356, #23424); the corpus stays as the regression guard, and the harness generalises to any directory of programs via --dir. Cases are deliberately mundane — multi-argument calls by producer kind, mixed producer kinds in one call, and the shapes the argument-resolution heuristics were individually tuned against (var_export, usort, in_array, array_merge, sprintf, by-ref, named args, spread, closures, static calls, constructor promotion). Exit status is the mismatch count so it can gate a build. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This was referenced Jul 26, 2026
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.
Adds the harness that found #23354, as a reusable gate.
The compliance suite asserts against recorded expectations, so it catches only what someone already thought to record. Nothing in the tree compared compiler output against Zend on arbitrary programs — which is why multi-argument calls handing every argument the trailing one's value survived undetected:
Both run to completion and print the wrong thing. No warning, no error, no failing test.
24 of these 43 programs mismatched Zend on master when the corpus was written. All are fixed (#23356, #23424); the corpus stays as the regression guard.
Exit status is the mismatch count, so it can gate a build.
Cases are deliberately mundane, because that is where silent wrong output hides: multi-argument calls by producer kind; mixed producer kinds in one call (where positional heuristics break); and the shapes the argument-resolution heuristics were individually tuned against —
var_export,usort,in_array/array_search,array_merge,array_slice,array_pad,sprintf,str_replace,substr, by-ref params, named args, spread, closures/arrow fns, static calls, constructor promotion.The README documents the one hard rule for new cases: they must be deterministic.
hrtime()is the live counter-example (#23443) — it is not monotonic here, so any case using it flips between runs and poisons regression comparisons.