Skip to content

AOT: restore DateTime::diff after two locals (unnamed New_ stamps) (#33906) - #33907

Merged
PurHur merged 1 commit into
masterfrom
fix/33906-datetime-diff-two-locals
Aug 22, 2026
Merged

PurHur merged 1 commit into
masterfrom
fix/33906-datetime-diff-two-locals

Conversation

@PurHur

@PurHur PurHur commented Aug 22, 2026

Copy link
Copy Markdown
Owner

Summary

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' → 9
  • DatePeriod two-bound foreach still 2020-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 → OK
  • Not covered: full ci-local / compliance suites

Made with Cursor

…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>
@PurHur
PurHur merged commit 91dc615 into master Aug 22, 2026
1 check failed
@PurHur
PurHur deleted the fix/33906-datetime-diff-two-locals branch August 22, 2026 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression: AOT DateTime::diff() fails after two locals — New_ resultOp unnamed so construct stamps never bind (re-#27309)

1 participant