We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 47a528a commit 359966eCopy full SHA for 359966e
Zend/tests/autoloading/function/local_function_pinned-to_global.phpt
@@ -0,0 +1,25 @@
1
+--TEST--
2
+Fallback to global function should trigger autoloading only once per namespace.
3
+--FILE--
4
+<?php
5
+
6
+namespace Bar {
7
+ if ( function_exists('Foo\strlen') ) {
8
+ var_dump(\Foo\strlen('hello'));
9
+ }
10
+}
11
+namespace Foo {
12
+ var_dump(strlen('hello')); // triggers name pinning
13
14
15
16
+ echo '\Foo\strlen() was bound to global \strlen()', \PHP_EOL;
17
18
19
20
21
+?>
22
+--EXPECT--
23
+int(5)
24
+\Foo\strlen() was bound to global \strlen()
25
0 commit comments