Category
stdlib
Status (2026-06-07 audit)
Partial landing. DateTime / DateTimeZone classes exist on the VM (class_exists('DateTime') → true), but OOP method dispatch is broken or stubbed for common paths. Procedural date() / gmdate() remain in ext/standard/date.php.
Do not re-implement the whole ext/date module in one PR — claim a child slice below.
| Gap |
Issue |
->format() / method dispatch (Method call on non-object) |
#5120 |
| JIT/AOT method lowering (phase 2) |
#4043 |
DateTimeInterface + ATOM constant |
#7141 |
__construct() malformed string / exception parity |
#7113, #7162 (enum operand TypeError) |
modify() enum modifier TypeError |
#6132 |
Static factories (createFromFormat, createFromTimestamp, …) |
#4659, #5973, #5936, #6518, #6197 |
getLastErrors() |
#4660 |
PHP 8.4 getMicrosecond() / setMicrosecond() |
#7082 |
Procedural date_add / date_diff / … |
#4604 |
Delete host \DateTime delegation |
#6164 (php-in-php) |
| Exception hierarchy |
#7276–#7279, #7129 |
Problem
Zend apps use DateTime / DateTimeImmutable / DateTimeZone for parsing, formatting, and time zones. This compiler registers class names but instance methods fail on typical scripts — blocking sessions, logging, and future self-host vendor code.
php-src reference
Repro (failure today — probed 2026-06-07)
<?php
$dt = new DateTime('2026-05-29', new DateTimeZone('UTC'));
echo $dt->format('Y-m-d');
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php -r "\$dt = new DateTime(\"2026-05-29\", new DateTimeZone(\"UTC\")); echo \$dt->format(\"Y-m-d\");"
php bin/vm.php -r "\$dt = new DateTime(\"2026-05-29\", new DateTimeZone(\"UTC\")); echo \$dt->format(\"Y-m-d\");"
'
| Runtime |
Result |
| Zend PHP 8.2 |
2026-05-29 |
bin/vm.php |
Method call on non-object (or similar fatal on ->format()) |
Scope (this repo — PHP-in-PHP first)
| Area |
Path |
| VM builtins |
ext/date/ or ext/standard/VmDate*.php — real handlers, not host new \DateTime long-term (#6164) |
| Class registry |
lib/VM/BuiltinClasses.php, lib/VM.php |
| Compiler |
new DateTime as builtin/user class |
| JIT/AOT |
#4043 — phase 1 VM-only methods acceptable for v1 |
| Matrix |
script/capability-matrix.php — syntax row already notes VM-only (capabilities-syntax.md) |
Done when (umbrella — close when children green)
Verification
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && ./script/ci-fast.sh --filter DateTime'
Links
Category
stdlibStatus (2026-06-07 audit)
Partial landing.
DateTime/DateTimeZoneclasses exist on the VM (class_exists('DateTime')→ true), but OOP method dispatch is broken or stubbed for common paths. Proceduraldate()/gmdate()remain inext/standard/date.php.Do not re-implement the whole ext/date module in one PR — claim a child slice below.
->format()/ method dispatch (Method call on non-object)DateTimeInterface+ATOMconstant__construct()malformed string / exception paritymodify()enum modifier TypeErrorcreateFromFormat,createFromTimestamp, …)getLastErrors()getMicrosecond()/setMicrosecond()date_add/date_diff/ …\DateTimedelegationProblem
Zend apps use
DateTime/DateTimeImmutable/DateTimeZonefor parsing, formatting, and time zones. This compiler registers class names but instance methods fail on typical scripts — blocking sessions, logging, and future self-host vendor code.php-src reference
ext/date/php_date.c— procedural APIext/date/php_datetime.c—DateTime,DateTimeImmutableext/date/php_datetime.stub.phpext/date/php_datetimezone.cRepro (failure today — probed 2026-06-07)
2026-05-29bin/vm.phpMethod call on non-object(or similar fatal on->format())Scope (this repo — PHP-in-PHP first)
ext/date/orext/standard/VmDate*.php— real handlers, not hostnew \DateTimelong-term (#6164)lib/VM/BuiltinClasses.php,lib/VM.phpnew DateTimeas builtin/user classscript/capability-matrix.php— syntax row already notes VM-only (capabilities-syntax.md)Done when (umbrella — close when children green)
2026-05-29on VM without host PHP date delegationinstanceof DateTime/DateTimeInterfaceparity (Stdlib: DateTime object identity — instanceof false and instance methods fail (ext/date/php_datetime.c) #5120, Stdlib: DateTimeInterface built-in interface missing — ATOM constant fetch + instanceof broken (ext/date/php_date.h) #7141)test/compliance/cases/stdlib/datetime_construct_format.phptgreen on VMVerification
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && ./script/ci-fast.sh --filter DateTime'Links
ext/standard/date.php,lib/JIT/Builtin/StringDateTime.php