Repository navigation
AOT: restore DateTime::diff after two locals (unnamed New_ stamps) (#33906) - #33907
Merged
Merged
Conversation
…ublish (#33906) #32691 stopped stamping compileTimeLong; New_ resultOps are often unnamed so dateTimeLocalInstants never bound $a/$b, and diff fell back to a LogicException. Publish the construct instant onto the first unstamped DateTime-shaped local (without clobbering siblings — #33744) and prefer compileTimeDateTimeTimestamp. 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
DateTime::__constructstampscompileTimeDateTimeTimestamp, butsyncDateTimeConstructMetaToAliasesonly publisheddateTimeLocalInstantswhen theNew_result Operand had a name. Temporaries are often unnamed, and named$a/$bbindings are different Variable objects than construct$this, so two-localdiffsaw a receiver with no stamp and threw (re-Regression: AOT DateTime::diff() segfaults after build — VM/JIT match Zend (ext/date/php_date.c) #27309).resolveCompileTimeInstant; keep NestedJIT__phpc_date_diff_scalarsfallback outside thin user AOT.php-src:
ext/date/php_date.c—zim_DateTime_diff/date_diff.Closes #33906
Test plan
./script/aot-smoke.sh→ 8/8./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && ./phpc build -o /tmp/d.bin test/repro/issue_33906_datetime_diff_two_locals_aot.php && /tmp/d.bin'→92020-01-01|2020-01-02|2020-01-03|./script/phpunit.sh --filter Issue33906DateTimeDiffTwoLocalsAotTest→ OK (3 tests, 16 assertions)vendor/bin/phpunit --filter datetime_diff_days test/aot/AotTest.php→ OKci-local/ compliance suitesMade with Cursor