Skip to content

Stdlib: fileatime()/filectime()/fileinode()/fileowner()/filegroup()/fileperms() — missing stat-failed E_WARNING (ext/standard/filestat.c) #10837

Description

@PurHur

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.cphp_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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:vmVirtual machineenhancementNew feature or requestimplementation-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