1
0
mirror of https://github.com/php/php-src.git synced 2026-04-21 23:18:13 +02:00
Files
archived-php-src/ext/standard/tests/streams/user-stream-error.phpt
T
Nikita Popov 2fdd142f99 Check for exception after applying stream filters
This makes the stream opening actually fail, and avoids assertion
failures when we tokenize with EG(exception) set.

Also avoid throwing an additional warning after an exception has
already been thrown.
2019-10-08 12:32:57 +02:00

21 lines
620 B
PHP

--TEST--
E_ERROR during UserStream Open
--FILE--
<?php
class FailStream {
public function stream_open($path, $mode, $options, &$opened_path) {
_some_undefined_function();
}
}
stream_wrapper_register('mystream', 'FailStream');
fopen('mystream://foo', 'r');
echo 'Done';
--EXPECTF--
Fatal error: Uncaught Error: Call to undefined function _some_undefined_function() in %s%euser-stream-error.php:%d
Stack trace:
#0 [internal function]: FailStream->stream_open('mystream://foo', 'r', 0, NULL)
#1 %s%euser-stream-error.php(%d): fopen('mystream://foo', 'r')
#2 {main}
thrown in %s%euser-stream-error.php on line %d