xref: /PHP-8.1/Zend/tests/bug41421.phpt (revision f8d79582)
1--TEST--
2Bug #41421 (Uncaught exception from a stream wrapper segfaults)
3--FILE--
4<?php
5
6class wrapper {
7    function stream_open() {
8        return true;
9    }
10    function stream_eof() {
11        throw new exception();
12    }
13}
14
15stream_wrapper_register("wrap", "wrapper");
16$fp = fopen("wrap://...", "r");
17feof($fp);
18
19echo "Done\n";
20?>
21--EXPECTF--
22Warning: feof(): wrapper::stream_eof is not implemented! Assuming EOF in %s on line %d
23
24Fatal error: Uncaught Exception in %s:%d
25Stack trace:
26#0 [internal function]: wrapper->stream_eof()
27#1 %s(%d): feof(Resource id #%d)
28#2 {main}
29  thrown in %s on line %d
30