diff --git a/Zend/tests/include_stat_is_quiet.phpt b/Zend/tests/include_stat_is_quiet.phpt
index 932885bd6665e..ef8240f9caff6 100644
--- a/Zend/tests/include_stat_is_quiet.phpt
+++ b/Zend/tests/include_stat_is_quiet.phpt
@@ -27,4 +27,7 @@ try {
--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
+Fatal error: Uncaught Error: Failed opening required 'doesnt_exist.php' (include_path='test://foo:test://bar') in %s:%d
+Stack trace:
+#0 {main}
+ thrown in %s on line %d
diff --git a/main/main.c b/main/main.c
index 6143718d05d42..0bbf54e16dd18 100644
--- a/main/main.c
+++ b/main/main.c
@@ -1618,7 +1618,7 @@ static ZEND_COLD void php_message_handler_for_zend(zend_long message, const void
php_error_docref("function.include", E_WARNING, "Failed opening '%s' for inclusion (include_path='%s')", php_strip_url_passwd((char *) data), STR_PRINT(PG(include_path)));
break;
case ZMSG_FAILED_REQUIRE_FOPEN:
- php_error_docref("function.require", E_COMPILE_ERROR, "Failed opening required '%s' (include_path='%s')", php_strip_url_passwd((char *) data), STR_PRINT(PG(include_path)));
+ zend_throw_error(NULL, "Failed opening required '%s' (include_path='%s')", php_strip_url_passwd((char *) data), STR_PRINT(PG(include_path)));
break;
case ZMSG_FAILED_HIGHLIGHT_FOPEN:
php_error_docref(NULL, E_WARNING, "Failed opening '%s' for highlighting", php_strip_url_passwd((char *) data));
diff --git a/tests/lang/bug35176.phpt b/tests/lang/bug35176.phpt
index cbba52055d0f0..c573c9c9de57f 100644
--- a/tests/lang/bug35176.phpt
+++ b/tests/lang/bug35176.phpt
@@ -12,4 +12,7 @@ require_once('nonexisiting.php');
Warning: require_once(nonexisiting.php) [function.require-once.html]: Failed to open stream: No such file or directory in %sbug35176.php on line 2
-Fatal error: require_once() [function.require.html]: Failed opening required 'nonexisiting.php' (%s) in %sbug35176.php on line 2
+Fatal error: Uncaught Error: Failed opening required 'nonexisiting.php' (include_path='%s') in %s:%d
+Stack trace:
+#0 {main}
+ thrown in %sbug35176.php on line 2