Last active
February 13, 2018 10:33
-
-
Save bitkorn/ec7b45f0bbe03b74c9c3f12b61dfe425 to your computer and use it in GitHub Desktop.
only functions are separated with multiple namespaces in a file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace A { | |
$closure = function () { | |
echo __NAMESPACE__; | |
}; | |
} | |
namespace B { | |
$closure = function () { | |
echo __NAMESPACE__; | |
}; | |
$var = 'foo'; | |
function foo() | |
{ | |
return 'foofunc()'; | |
} | |
} | |
namespace C { | |
use function B\foo; | |
$closure(); | |
echo '<br>'; | |
echo $var; | |
echo '<br>'; | |
echo foo(); // only this require a use statement | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment