Commit da4babf4fa1 for php

commit da4babf4fa1e68192c95cf8674cbdffff3647f75
Author: Daniel Scherzer <daniel.e.scherzer+phpf@gmail.com>
Date:   Mon Sep 28 17:22:14 2026 -0700

    ext/zip: add regression tests for behavior with `ZIP_CREATE`

    A follow-up commit will switch the uses of the `ZIP_CREATE` to instead use
    `ZIP_RDONLY` when creation is not desired; add tests to confirm that doing so
    does not change the actual behavior of the extension.

diff --git a/ext/zip/tests/stats_existing.phpt b/ext/zip/tests/stats_existing.phpt
new file mode 100644
index 00000000000..a3d0190b8cd
--- /dev/null
+++ b/ext/zip/tests/stats_existing.phpt
@@ -0,0 +1,39 @@
+--TEST--
+Regression tests for behavior when the requested zip does exist
+--EXTENSIONS--
+zip
+--FILE--
+<?php
+$target = __DIR__ . '/test.zip';
+
+echo "Stat:\n";
+var_dump(stat("zip://$target#entry1.txt"));
+
+echo "\nFile contents:\n";
+var_dump(file_get_contents("zip://$target#entry1.txt"));
+
+$fp = fopen("zip://$target#entry1.txt", 'rb');
+
+$fstat = fstat($fp);
+echo "\nFstat size:\n";
+var_dump($fstat['size']);
+
+echo "\nStream contents:\n";
+var_dump(stream_get_contents($fp));
+
+fclose($fp);
+?>
+--EXPECTF--
+Stat:
+
+Warning: stat(): stat failed for zip://%stest.zip#entry1.txt in %s on line %d
+bool(false)
+
+File contents:
+string(8) "entry #1"
+
+Fstat size:
+int(8)
+
+Stream contents:
+string(8) "entry #1"
diff --git a/ext/zip/tests/stats_missing.phpt b/ext/zip/tests/stats_missing.phpt
new file mode 100644
index 00000000000..5f4df5745c3
--- /dev/null
+++ b/ext/zip/tests/stats_missing.phpt
@@ -0,0 +1,47 @@
+--TEST--
+Regression tests for behavior when the requested zip does not exist
+--EXTENSIONS--
+zip
+--FILE--
+<?php
+$target = __DIR__ . '/target.zip';
+assert(!file_exists($target), 'target.zip should not exist at the start');
+
+echo "Stat:\n";
+var_dump(stat("zip://$target#entry.txt"));
+assert(!file_exists($target), 'target.zip should not exist after stat()');
+
+echo "\n\nFile contents:\n";
+var_dump(file_get_contents("zip://$target#entry.txt"));
+assert(!file_exists($target), 'target.zip should not exist after file_get_contents()');
+
+echo "\n\nFopen:\n";
+var_dump(fopen("zip://$target#entry.txt", 'r'));
+assert(!file_exists($target), 'target.zip should not exist after fopen() for reading');
+
+echo "\n\nOn a missing directory:\n";
+var_dump(stat('zip:///nonexistent_dir_xyz/target.zip#entry.txt'));
+?>
+--EXPECTF--
+Stat:
+
+Warning: stat(): stat failed for zip://%starget.zip#entry.txt in %s on line %d
+bool(false)
+
+
+File contents:
+
+Warning: file_get_contents(): Failed to open stream: operation failed in %s on line %d
+bool(false)
+
+
+Fopen:
+
+Warning: fopen(): Failed to open stream: operation failed in %s on line %d
+bool(false)
+
+
+On a missing directory:
+
+Warning: stat(): stat failed for zip:///nonexistent_dir_xyz/target.zip#entry.txt in %s on line %d
+bool(false)
diff --git a/ext/zip/tests/stats_nonzip.phpt b/ext/zip/tests/stats_nonzip.phpt
new file mode 100644
index 00000000000..ef24c4c2c32
--- /dev/null
+++ b/ext/zip/tests/stats_nonzip.phpt
@@ -0,0 +1,25 @@
+--TEST--
+Regression tests for behavior when the requested zip is not a zip file
+--EXTENSIONS--
+zip
+--FILE--
+<?php
+$target = __FILE__;
+
+echo "Stat:\n";
+var_dump(stat("zip://$target#entry1.txt"));
+
+echo "\n\nFile contents:\n";
+var_dump(file_get_contents("zip://$target#entry1.txt"));
+?>
+--EXPECTF--
+Stat:
+
+Warning: stat(): stat failed for zip://%sstats_nonzip.php#entry1.txt in %s on line %d
+bool(false)
+
+
+File contents:
+
+Warning: file_get_contents(): Failed to open stream: operation failed in %s on line %d
+bool(false)