1--TEST--
2Make sure exceptions during include/require stating are properly propagated
3--FILE--
4<?php
5
6class StreamWrapper {
7    public function url_stat($path, $flags) {
8        throw new Exception('stat failed');
9    }
10}
11
12stream_wrapper_register('test', StreamWrapper::class);
13set_include_path('test://foo:test://bar');
14
15try {
16    require_once 'doesnt_exist.php';
17} catch (Exception $e) {
18    echo $e->getMessage(), "\n";
19}
20try {
21    require 'doesnt_exist.php';
22} catch (Exception $e) {
23    echo $e->getMessage(), "\n";
24}
25try {
26    include_once 'doesnt_exist.php';
27} catch (Exception $e) {
28    echo $e->getMessage(), "\n";
29}
30try {
31    include 'doesnt_exist.php';
32} catch (Exception $e) {
33    echo $e->getMessage(), "\n";
34}
35
36?>
37--EXPECT--
38stat failed
39stat failed
40stat failed
41stat failed
42