Skip to content

Stdlib: DateTime accepts Y-m-d H:i without seconds (#25309) - #25340

Merged
PurHur merged 1 commit into
masterfrom
agent/advanced-stdlib-25309-datetime-hour-minute
Jul 30, 2026
Merged

Stdlib: DateTime accepts Y-m-d H:i without seconds (#25309)#25340
PurHur merged 1 commit into
masterfrom
agent/advanced-stdlib-25309-datetime-hour-minute

Conversation

@PurHur

@PurHur PurHur commented Jul 30, 2026

Copy link
Copy Markdown
Owner

Summary

  • Relax VmDateTimeNative::parseDateTimeAbsolute() ISO regex so Y-m-d H:i / Y-m-dTH:i parse with seconds defaulting to 0 (timelib / php-src parse_date.re).
  • Covers DateTime, DateTimeImmutable, and date_create().

Closes #25309

Test plan

  • Zend/VM/JIT bit-identical on test/repro/maintainer_gap_datetime_hour_minute.php
  • vendor/bin/phpunit --filter datetime_hour_minute_no_seconds — OK (2 tests)
  • AOT new DateTime(...) segfaults on master for this surface (pre-existing)

php-src reference

  • ext/date/lib/parse_date.re — absolute Y-M-D + optional time with optional seconds

Made with Cursor

Relax VmDateTimeNative absolute ISO regex so hour+minute parses
with seconds defaulting to 0, matching timelib/php-src parse_date.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit 1187c0c into master Jul 30, 2026
1 check failed
@PurHur
PurHur deleted the agent/advanced-stdlib-25309-datetime-hour-minute branch July 30, 2026 10:48
PurHur added a commit that referenced this pull request Jul 30, 2026
Re-emit DateTime/timezone, DOM, and Preg helper TUs after #25340/#25341/#25342
so check-helper-runtime-prelink --strict and release-readiness stay green.

Closes #25347

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.

Regression: DateTime rejects Y-m-d H:i without seconds — Zend parses (ext/date/php_date.c)

1 participant