mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
main: refactor userstream method calling
Closes GH-19312
This commit is contained in:
parent
e5f81bd74c
commit
0992265611
4 changed files with 432 additions and 423 deletions
|
@ -9,22 +9,19 @@ class wrapper {
|
|||
return true;
|
||||
}
|
||||
function stream_eof() {
|
||||
throw new exception();
|
||||
throw new Exception('cannot eof');
|
||||
}
|
||||
}
|
||||
|
||||
stream_wrapper_register("wrap", "wrapper");
|
||||
$fp = fopen("wrap://...", "r");
|
||||
feof($fp);
|
||||
|
||||
echo "Done\n";
|
||||
try {
|
||||
feof($fp);
|
||||
} catch (Throwable $e) {
|
||||
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: feof(): wrapper::stream_eof is not implemented! Assuming EOF in %s on line %d
|
||||
|
||||
Fatal error: Uncaught Exception in %s:%d
|
||||
Stack trace:
|
||||
#0 [internal function]: wrapper->stream_eof()
|
||||
#1 %s(%d): feof(Resource id #%d)
|
||||
#2 {main}
|
||||
thrown in %s on line %d
|
||||
--EXPECT--
|
||||
Exception: cannot eof
|
||||
|
|
|
@ -65,5 +65,5 @@ ftruncate(): Argument #2 ($size) must be greater than or equal to 0
|
|||
------ stream_truncate bad return: -------
|
||||
truncation with new_size=0
|
||||
|
||||
Warning: ftruncate(): test_wrapper_bad::stream_truncate did not return a boolean! in %s on line %d
|
||||
Warning: ftruncate(): test_wrapper_bad::stream_truncate value must be of type bool, string given in %s on line %d
|
||||
bool(false)
|
||||
|
|
|
@ -28,5 +28,5 @@ $a = $zip->extractTo('teststream://test');
|
|||
var_dump($a);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: ZipArchive::extractTo(teststream://test/foo): Failed to open stream: "TestStream::stream_open" call failed in %s on line %d
|
||||
Warning: ZipArchive::extractTo(teststream://test/foo): Failed to open stream: "TestStream::stream_open" is not implemented in %s on line %d
|
||||
bool(false)
|
||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue