summaryrefslogtreecommitdiff
path: root/Zend/tests/require_once_warning_to_exception.phpt
blob: d115ac68ccdef779d1b207dc408d4b11bccfe03d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
--TEST--
Promoting require_once warning to exception
--FILE--
<?php

function exception_error_handler($errno, $errstr, $errfile, $errline ) {
    throw new Exception($errstr);
}
set_error_handler("exception_error_handler");

try {
    $results = require_once 'does-not-exist.php';
} catch (Exception $e) {
    echo $e->getMessage(), "\n";
};

?>
--EXPECT--
require_once(does-not-exist.php): Failed to open stream: No such file or directory