Category
php-in-php · php-src-strict
Problem
VM date builtins (mktime, gmmktime, strftime, strptime, gmstrftime, …) are implemented in ext/standard/ PHP (VmDate.php, VmDateTimeNative.php, per-function wrappers). JIT/AOT still register LLVM helpers in:
lib/JIT/Builtin/StringMktime.php — __compiler_mktime via libc mktime(3) + struct tm offsets
lib/JIT/Builtin/StringStrftime.php — __compiler_strftime via libc strftime
lib/JIT/Builtin/StringStrptime.php — __compiler_strptime via libc strptime
lib/JIT/Builtin/Type.php — __compiler_gmmktime, __compiler_gmgetdate, …
This duplicates calendar math, timezone/DST handling, and enum operand guards already centralized in PHP (#8770 umbrella for mutation helpers — this issue covers formatting/parsing LLVM builtins).
php-src reference
- php/php-src
ext/date/php_date.c — PHP_FUNCTION(mktime), strftime, strptime
- VM mirror:
ext/standard/VmDate.php, ext/standard/VmDateTimeNative.php, ext/standard/mktime.php, strftime.php, strptime.php
Repro
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php bin/vm.php -r "var_export(mktime(0,0,0,6,17,2026)); echo PHP_EOL;"
php bin/jit.php -r "var_export(mktime(0,0,0,6,17,2026)); echo PHP_EOL;"
# JIT lowers via __compiler_mktime (StringMktime.php libc layout constants)'
Scope
| Layer |
Path |
| JIT |
lib/JIT/Builtin/StringMktime.php, StringStrftime.php, StringStrptime.php |
| Wiring |
lib/JIT/Builtin/Type.php calendar __compiler_* symbols |
| PHP helpers |
ext/standard/VmDateTimeNative.php (extend if needed) |
No new C runtime — shrink glibc struct tm offset tables in JIT sources |
|
Done when
Ref: #1492, #6706 (gmmktime presence), #3692/#3694
Category
php-in-php· php-src-strictProblem
VM date builtins (
mktime,gmmktime,strftime,strptime,gmstrftime, …) are implemented inext/standard/PHP (VmDate.php,VmDateTimeNative.php, per-function wrappers). JIT/AOT still register LLVM helpers in:lib/JIT/Builtin/StringMktime.php—__compiler_mktimevia libcmktime(3)+struct tmoffsetslib/JIT/Builtin/StringStrftime.php—__compiler_strftimevia libcstrftimelib/JIT/Builtin/StringStrptime.php—__compiler_strptimevia libcstrptimelib/JIT/Builtin/Type.php—__compiler_gmmktime,__compiler_gmgetdate, …This duplicates calendar math, timezone/DST handling, and enum operand guards already centralized in PHP (#8770 umbrella for mutation helpers — this issue covers formatting/parsing LLVM builtins).
php-src reference
ext/date/php_date.c—PHP_FUNCTION(mktime),strftime,strptimeext/standard/VmDate.php,ext/standard/VmDateTimeNative.php,ext/standard/mktime.php,strftime.php,strptime.phpRepro
Scope
lib/JIT/Builtin/StringMktime.php,StringStrftime.php,StringStrptime.phplib/JIT/Builtin/Type.phpcalendar__compiler_*symbolsext/standard/VmDateTimeNative.php(extend if needed)struct tmoffset tables in JIT sourcesDone when
mktime/gmmktime/strftime/strptimematch VM + Zend on compliance date PHPTsstruct tmlayout constants for default pathRef: #1492, #6706 (gmmktime presence), #3692/#3694