Skip to content

Commit b1196a3

Browse files
committed
Check non-existent function calls autoloader twice.
1 parent f7e455b commit b1196a3

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
--TEST--
2+
Fallback to non-existent function triggers autoloading once in namespace, once in global.
3+
--FILE--
4+
<?php
5+
6+
namespace {
7+
function loader($name) {
8+
echo "function loader called with $name\n";
9+
}
10+
11+
autoload_register_function('loader');
12+
}
13+
14+
namespace bar {
15+
try {
16+
non_existent_function();
17+
}
18+
catch (\Error $e) {
19+
echo "Error correctly caught: " . $e->getMessage() . "\n";
20+
}
21+
}
22+
23+
?>
24+
--EXPECT--
25+
function loader called with bar\non_existent_function
26+
function loader called with non_existent_function
27+
Error correctly caught: Call to undefined function bar\non_existent_function()

0 commit comments

Comments
 (0)