Skip to content

Stdlib: DateTime / DateTimeZone OOP (ext/date parity, #3072)#3104

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-3072-datetime-oop
May 29, 2026
Merged

Stdlib: DateTime / DateTimeZone OOP (ext/date parity, #3072)#3104
PurHur merged 1 commit into
masterfrom
agent/issue-3072-datetime-oop

Conversation

@PurHur
Copy link
Copy Markdown
Owner

@PurHur PurHur commented May 29, 2026

Summary

  • Register VM builtin DateTime and DateTimeZone classes with phase-1 methods: __construct, format, getTimestamp, setTimezone (DateTimeZone: __construct only).
  • Parsing/formatting delegates to host PHP DateTime/DateTimeZone for Zend parity on UTC and named timezones.
  • Adds compliance PHPT + unit tests and capability-syntax row.

php-src reference

  • ext/date/php_datetime.c, ext/date/php_datetimezone.c, ext/date/php_datetime.stub.php

Verification

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php bin/vm.php -r "\$dt = new DateTime(\"2026-05-29\", new DateTimeZone(\"UTC\")); echo \$dt->format(\"Y-m-d\");"'
# Expected: 2026-05-29

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && ./vendor/bin/phpunit --filter DateTimeTest'

Closes #3072

Made with Cursor

Register phase-1 OOP date classes with __construct, format, getTimestamp,
and setTimezone using host PHP date parsing (php-src ext/date/php_datetime.c).

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur PurHur merged commit ed90062 into master May 29, 2026
@PurHur PurHur deleted the agent/issue-3072-datetime-oop branch May 29, 2026 13:33
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: DateTime / DateTimeImmutable OOP (ext/date parity)

1 participant