diff options
Diffstat (limited to 'Zend/tests')
-rw-r--r-- | Zend/tests/include_stat_is_quiet.phpt | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Zend/tests/include_stat_is_quiet.phpt b/Zend/tests/include_stat_is_quiet.phpt new file mode 100644 index 0000000000..006fad50bd --- /dev/null +++ b/Zend/tests/include_stat_is_quiet.phpt @@ -0,0 +1,30 @@ +--TEST-- +Stats executed during include path resolution should be silent +--FILE-- +<?php + +class StreamWrapper { + public function url_stat($path, $flags) { + $path = str_replace('test://', 'file://', $path); + if ($flags & STREAM_URL_STAT_QUIET) { + return @stat($path); + } else { + return stat($path); + } + } +} + +stream_wrapper_register('test', StreamWrapper::class); +set_include_path('test://foo:test://bar'); + +try { + require_once 'doesnt_exist.php'; +} catch (Exception $e) { + echo $e->getMessage(), "\n"; +} + +?> +--EXPECTF-- +Warning: require_once(doesnt_exist.php): failed to open stream: No such file or directory in %s on line %d + +Fatal error: require_once(): Failed opening required 'doesnt_exist.php' (include_path='test://foo:test://bar') in %s on line %d |