Category
bug · php-src-strict · Reflection stubs · pillar 4
Problem
ReflectionFunction('touch') reports $mtime / $atime as int with default NULL. php-src / Zend declare ?int $mtime = null / ?int $atime = null (ext/standard/file.stub.php). Nullable Reflection types matter for static analysis and named-arg tooling.
Probed 2026-08-07 @ fdf529e8bd (VM vs host Zend 8.2.32 / stub PHP-8.4.11).
| Param |
Zend / php-src |
VM |
mtime |
?int default null |
int default NULL |
atime |
?int default null |
int default NULL |
php-src reference
PHP implementation target
- Builtin Reflection metadata for
touch in ext/standard/ / VM introspection — nullable int params
- PHP-in-PHP; no new C
Repro
./script/docker-exec.sh -- bash -lc 'php bin/vm.php -r '"'"'
$r=new ReflectionFunction("touch");
foreach ($r->getParameters() as $p) {
echo $p->getName(), ":", ($p->hasType()?(string)$p->getType():"-"), "\n";
}
'"'"''
# Expect: mtime:?int / atime:?int
# Actual: mtime:int / atime:int
Done when
Category
bug· php-src-strict · Reflection stubs · pillar 4Problem
ReflectionFunction('touch')reports$mtime/$atimeasintwith defaultNULL. php-src / Zend declare?int $mtime = null/?int $atime = null(ext/standard/file.stub.php). Nullable Reflection types matter for static analysis and named-arg tooling.Probed 2026-08-07 @
fdf529e8bd(VM vs host Zend 8.2.32 / stub PHP-8.4.11).mtime?intdefaultnullintdefaultNULLatime?intdefaultnullintdefaultNULLphp-src reference
ext/standard/file.stub.php—function touch(string $filename, ?int $mtime = null, ?int $atime = null): boolPHP implementation target
touchinext/standard// VM introspection — nullable int paramsRepro
Done when
?intmatching Zendtouch($f, null, null)still matches Zend