Skip to content

AOT: DateTime add/sub with runtime DateInterval (#33781) - #33786

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-33781-datetime-runtime-interval-aot
Aug 22, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-33781-datetime-runtime-interval-aot

Conversation

@PurHur

@PurHur PurHur commented Aug 22, 2026

Copy link
Copy Markdown
Owner

Summary

php-src reference

  • ext/date/php_date.c — date_add / date_sub / DateTime::add

Verification

./script/aot-smoke.sh
# aot-smoke: 8 passed, 0 failed

./script/phpunit.sh --filter 'DateTimeAddSubAotTest'
# OK (2 tests, 10 assertions)

./script/docker-exec.sh -- bash -lc 'php bin/compile.php -o /tmp/di33781.bin test/repro/issue_33781_datetime_runtime_interval_aot.php && /tmp/di33781.bin'
# 2020-02-15
# 2020-01-16

Not covered: truly dynamic intervals where compileTimeDateInterval is absent (computed spec at runtime) — still uses runtime property-read LLVM path; month reads need follow-up if that case matters.

Closes #33781

Made with Cursor

…LLVM (#33781)

Thin user-script AOT cannot NestedJIT DateMutationRuntime (__nativearray__boundscheck).
When compileTimeDateInterval is known on the argument, apply y/m/d via JitGetdate civil
math (same approach as modify +1 month). Removes the #30760 compile-time-only throw.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit bafd740 into master Aug 22, 2026
@PurHur
PurHur deleted the agent/issue-33781-datetime-runtime-interval-aot branch August 22, 2026 05:38
PurHur added a commit that referenced this pull request Aug 22, 2026
…ering (#33781 leftover). (#33803)

The OOP add/sub path was fixed in #33786 but date_add() still used a separate
requireDateTimeObject + returnObjectArg lowering that aborted (rc=134) on runtime
P1M intervals under user AOT.

Co-authored-by: PurHur <PurHur@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
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.

AOT: DateTime{,Immutable}::add/sub with runtime DateInterval aborts compile (re-#30760, ext/date/php_date.c)

1 participant