Summary
Several file*() stat accessors return false on missing paths without the E_WARNING Zend emits (stat failed for …). filemtime() and filetype() already warn via VmFilestatFailure; these siblings do not.
Repro
./script/docker-exec.sh -- php bin/vm.php test/repro/maintainer_gap_fileatime_stat_warning.php
Zend: six PHP Warning: {fn}(): stat failed for /nope/... lines before false.
This compiler: silent false for all six functions.
Affected: fileatime, filectime, fileinode, fileowner, filegroup, fileperms.
php-src reference
ext/standard/filestat.c — php_stat() failure path triggers warnings per accessor.
Implementation (PHP-in-PHP)
- Mirror
ext/standard/filemtime.php: on false === stat result call VmFilestatFailure::warnPathStatFailed($frame, '<fn>', $path, $lstat=false).
- Apply in
fileatime.php, filectime.php, fileinode.php, fileowner.php, filegroup.php, fileperms.php (+ JIT JitStat.php if LLVM path skips warnings).
Done when (php-src-strict)
- VM run of repro emits six warnings matching Zend wording.
- Targeted compliance guard per function (missing path → warning +
false).
Related: #10547 (filesize() NULL + no warning), #5122 (is_file path coercion warnings).
Refs #1492
Summary
Several
file*()stat accessors returnfalseon missing paths without theE_WARNINGZend emits (stat failed for …).filemtime()andfiletype()already warn viaVmFilestatFailure; these siblings do not.Repro
Zend: six
PHP Warning: {fn}(): stat failed for /nope/...lines beforefalse.This compiler: silent
falsefor all six functions.Affected:
fileatime,filectime,fileinode,fileowner,filegroup,fileperms.php-src reference
ext/standard/filestat.c—php_stat()failure path triggers warnings per accessor.Implementation (PHP-in-PHP)
ext/standard/filemtime.php: onfalse ===stat result callVmFilestatFailure::warnPathStatFailed($frame, '<fn>', $path, $lstat=false).fileatime.php,filectime.php,fileinode.php,fileowner.php,filegroup.php,fileperms.php(+ JITJitStat.phpif LLVM path skips warnings).Done when (php-src-strict)
false).Related: #10547 (
filesize()NULL + no warning), #5122 (is_file path coercion warnings).Refs #1492