Skip to content

Regression: touch() Reflection mtime/atime int — Zend ?int (ext/standard/file.stub.php) #28558

Description

@PurHur

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

  • Reflection param types are ?int matching Zend
  • Runtime touch($f, null, null) still matches Zend
  • Compliance/unit guard; php-src-strict

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:vmVirtual machinebugSomething isn't workingimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-4:stdlibPhase 4 – stdlib for web appsstdlib

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions