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