1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/Zend/tests/bug41421.phpt
Gina Peter Banyard 0992265611 main: refactor userstream method calling
Closes GH-19312
2025-08-15 18:41:17 +02:00

28 lines
477 B
PHP

--TEST--
Bug #41421 (Uncaught exception from a stream wrapper segfaults)
--FILE--
<?php
class wrapper {
public $context;
function stream_open() {
return true;
}
function stream_eof() {
throw new Exception('cannot eof');
}
}
stream_wrapper_register("wrap", "wrapper");
$fp = fopen("wrap://...", "r");
try {
feof($fp);
} catch (Throwable $e) {
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
Exception: cannot eof