1
0
mirror of https://github.com/php/php-src.git synced 2026-04-29 19:23:22 +02:00
Files
Gina Peter Banyard 0992265611 main: refactor userstream method calling
Closes GH-19312
2025-08-15 18:41:17 +02:00

33 lines
747 B
PHP

--TEST--
Bug #53603 (ZipArchive should quiet stat errors)
--EXTENSIONS--
zip
--FILE--
<?php
class TestStream {
public $context;
function url_stat($path, $flags) {
if (!($flags & STREAM_URL_STAT_QUIET))
trigger_error("not quiet");
return array();
}
}
stream_wrapper_register("teststream", "TestStream");
$dirname = __DIR__ . '/';
$file = $dirname . 'test_with_comment.zip';
$zip = new ZipArchive;
if ($zip->open($file) !== TRUE) {
echo "open failed.\n";
exit('failed');
}
$a = $zip->extractTo('teststream://test');
var_dump($a);
?>
--EXPECTF--
Warning: ZipArchive::extractTo(teststream://test/foo): Failed to open stream: "TestStream::stream_open" is not implemented in %s on line %d
bool(false)