Skip to content

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

Closed
PurHur wants to merge 1 commit into
masterfrom
agent/issue-33781-datetime-runtime-interval-aot
Closed

PurHur wants to merge 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

  • Remove thin-AOT hard-throw in DateTime{,Immutable}::add/sub when the interval has year/month components (P1M, etc.).
  • For thin user-script AOT, apply compile-time-known DateInterval state via UTC civil LLVM (JitGetdate) — same shape as modify('+1 month') — avoiding NestedJIT DateMutationJitHelper (which needs __nativearray__boundscheck).
  • Non-thin AOT still uses DateMutationRuntime / __phpc_date_apply_interval.

php-src: ext/date/php_date.c — date_add / DateTime::add

Verification

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

./script/phpunit.sh --filter Issue33781DateTimeRuntimeIntervalAotTest
# OK (1 test, 4 assertions)

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

Not run: full ./script/ci-local.sh

Closes #33781

Made with Cursor

Thin user-script AOT threw LogicException when DateInterval had year/month
components. Route compile-time-known interval state through JitGetdate civil
IR instead of NestedJIT DateMutationJitHelper (needs __nativearray__boundscheck).

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur

PurHur commented Aug 22, 2026

Copy link
Copy Markdown
Owner Author

Duplicate of merged #33786 — master repro green @ bafd740.

@PurHur PurHur closed this Aug 22, 2026
@PurHur
PurHur deleted the agent/issue-33781-datetime-runtime-interval-aot branch August 30, 2026 05:07
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