We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 90c39d3 commit 7aaae2eCopy full SHA for 7aaae2e
Zend/tests/autoloading/function/function_exists_unpinned_local_function_returns_false.phpt
@@ -0,0 +1,31 @@
1
+--TEST--
2
+function_exist of local function returns false even with global one defined
3
+--FILE--
4
+<?php
5
+namespace {
6
+ function loader($name) {
7
+ echo "function loader called with $name\n";
8
+ }
9
+
10
+ autoload_register_function('loader');
11
12
+ function bar() {
13
+ echo "I am bar in global namespace.\n";
14
15
+}
16
17
+namespace foo {
18
+ if (!function_exists(__NAMESPACE__.'\\bar')) {
19
20
+ echo "I'm bar in foo namespace";
21
22
23
24
+ bar();
25
26
27
+?>
28
+--EXPECT--
29
+function loader called with foo\function_exists
30
+function loader called with foo\bar
31
+I'm bar in foo namespace
0 commit comments