As pointed out in comments on bug #66216.
--- /dev/null
+--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
already_compiled:
new_op_array = ZEND_FAKE_OP_ARRAY;
}
- } else {
+ } else if (!EG(exception)) {
zend_message_dispatcher(
(type == ZEND_INCLUDE_ONCE) ?
ZMSG_FAILED_INCLUDE_FOPEN : ZMSG_FAILED_REQUIRE_FOPEN,