Skip to content

Regression: touch(null)/touch('') — spurious E_WARNING before false return (re-#12653, ext/standard/filestat.c) #13343

Closed

Description

@PurHur

Category

stdlib · php-src-strict · regression

Problem

touch(null) and touch('') correctly return false on the VM, but emit extra E_WARNING lines that Zend does not produce for empty paths.

Step Zend 8.2 VM (today)
touch(null) / touch('') false, no warning false + touch(): Unable to create file because No such file or directory ❌

Closed #12653 fixed ValueError-vs-false; this scopes the warning regression.

php-src reference

PHP implementation target

  • ext/standard/touch.php — reject null/empty before filesystem attempt; no warning
  • PHP-in-PHP first

Repro (verified 2026-06-28)

./script/docker-exec.sh -- bash -lc 'php test/repro/maintainer_gap_touch_null_false.php 2>&1'
./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/maintainer_gap_touch_null_false.php 2>&1'
# VM prints two PHP Warning lines; Zend prints only "ok"

Done when (php-src-strict)

  • touch(null) and touch('') return false with no E_WARNING (match Zend stderr)
  • Repro prints ok with identical stderr to Zend
  • Compliance guard under test/compliance/cases/stdlib/touch_null_false.phpt

Verification

./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/maintainer_gap_touch_null_false.php 2>&1 | grep -c Warning'
# expect 0

Links

Activity

  1. added
    enhancementNew feature or request
    phase-4:stdlibPhase 4 – stdlib for web apps
    area:vmVirtual machine
    implementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claim
    on Jun 28, 2026
  2. PurHur commented on Jun 28, 2026

    @PurHur
    OwnerAuthor

    claim: PHP Compiler STD Lib — batch (issues #13343, #13344)

  3. PurHur commented on Jun 28, 2026

    @PurHur
    OwnerAuthor

    Merged via #13351. Verification: php bin/vm.php test/repro/maintainer_gap_touch_null_false.php prints ok with 0 Warning lines; phpunit --filter touch_null_false green; AOT lint exit 0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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