Test: cover script-scope pre-decrement and mixed ++/-- runs (#23840 follow-on) - #23867
Merged
Merged
Conversation
…ollow-on) #23840 made every script-scope ++/-- a no-op. The cases added with its fix gate two shapes: plain post-decrement (g08_incdec_post_dec) and ++ inside a script-scope loop (g08_toplevel_incdec_echo). Neither covers: --$n pre-decrement at script scope $n++; $n++; $n--; a run mixing both forms on one variable $z--; past zero the sign flip --$p vs $q-- both forms storing the same value All of those were equally broken while #23840 was live, and nothing exercises them today. Kept top-level deliberately: the regression only ever appeared at script scope, because every pre-existing ++/-- differential case declares its variables inside a function. That gap is what let it ship. Verified on master f98ba35, both backends explicitly: VM — run directly against bin/vm.php: matches Zend (4 / 2 / 3 / -2 / 9 9) AOT — ok in script/differential-sweep.sh --aot Checked VM by hand rather than reading it off a sweep: the sweep run that covered AOT had already globbed its case list before this file existed, so its VM section does not include it. Inferring a pass from absence is exactly the mistake that let #23840 through (see the correction on #23781). Test only, no lib/ changes.
PurHur
force-pushed
the
test/g09-predec-coverage
branch
from
July 27, 2026 14:36
c3f7749 to
e7a0ac9
Compare
This was referenced Jul 27, 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.
Gap
#23840 made every script-scope
++/--a no-op. The cases that landed with its fix gate twoshapes:
g08_incdec_post_dec$n--g08_toplevel_incdec_echo$a++, and++inside a script-scope loopNeither covers pre-decrement (
--$n), nor a run that mixes both forms on one variable. Bothwere equally broken while #23840 was live, and nothing exercises them today.
Added
Kept top-level on purpose. The regression only ever appeared at script scope, because every
pre-existing
++/--differential case declares its variables inside a function — that gap is whatlet it ship.
Verified on master
f98ba3500, both backendsbin/vm.php: matches Zend (4 / 2 / 3 / -2 / 9 9)ok g09_toplevel_predec_mixed.phpinscript/differential-sweep.sh --aotI checked VM by hand rather than reading it off the sweep. The sweep run that covered AOT had
already globbed its case list before this file existed, so its VM section does not list it — and
inferring "passed" from "absent" is exactly the mistake that let #23840 through in the first place
(correction on #23781). Same trap, caught this time.
Sweep health on that commit, for reference
Test only, no
lib/changes.