Skip to content

Stdlib: DateInterval::createFromDateString next/last day words (#27954) - #27968

Merged
PurHur merged 1 commit into
masterfrom
fix/27954-dateinterval-relative-day-words
Aug 6, 2026
Merged

Stdlib: DateInterval::createFromDateString next/last day words (#27954)#27968
PurHur merged 1 commit into
masterfrom
fix/27954-dateinterval-relative-day-words

Conversation

@PurHur

@PurHur PurHur commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • Accept yesterday / tomorrow and next|last|previous|this day(s) in DateInterval::createFromDateString / date_interval_create_from_date_string, matching Zend signed $d with invert=0.
  • Shared parse path: ext/standard/VmDateInterval::tryParseRelativeTextInterval (VM + JIT compile-time literals).
  • php-src: ext/date/php_date.c, ext/date/lib/parse_date.re.

Closes #27954

Test plan

  • Zend / bin/vm.php / bin/jit.php on test/repro/issue_27954_dateinterval_relative_day_words.php — identical output
  • vendor/bin/phpunit --filter DateIntervalCreateFromDateStringTest — OK (5 tests)
  • Compliance .phpt + unit guard for relative day words
  • Not run: full ci-fast / compliance suite (pre-existing PHPT parse abort in VMTest discovery)

Verification transcript

=== ZEND / VM / JIT ===
next day => d=1 invert=0
last day => d=-1 invert=0
yesterday => d=-1 invert=0
tomorrow => d=1 invert=0
1 day => d=1 invert=0
previous day => d=-1 invert=0
this day => d=0 invert=0
fn tomorrow => d=1 invert=0

OK (5 tests, 16 assertions) — DateIntervalCreateFromDateStringTest

Made with Cursor

Accept yesterday/tomorrow and next|last|previous|this day(s) with Zend-matching signed $d (invert=0).

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit fe2671d into master Aug 6, 2026
1 check failed
@PurHur
PurHur deleted the fix/27954-dateinterval-relative-day-words branch August 6, 2026 01:35
PurHur added a commit that referenced this pull request Aug 6, 2026
#27971)

#27966/#27968/#27969 landed past the last verified-fresh argv seed,
re-staling lowering_source_fingerprint (4f-m / #8713). Rebuild
bin-compile-aot on tip (e363d9206231…, verified-fresh) — no restamp.

Co-authored-by: PurHur <PurHur@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
PurHur added a commit that referenced this pull request Aug 6, 2026
#27973)

#27966/#27968/#27969 landed past the last verified-fresh argv seed,
re-staling lowering_source_fingerprint (4f-m / #8713). Rebuild
bin-compile-aot on tip (e363d9206231…, verified-fresh) — no restamp.

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.

Stdlib: DateInterval::createFromDateString rejects 'next/last day', yesterday, tomorrow — Zend sets $d (ext/date/php_date.c)

1 participant