Created
December 13, 2011 16:46
-
-
Save tinnet/1472866 to your computer and use it in GitHub Desktop.
using namespaces to override global functions(?)
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 FOO; | |
function strlen($arg) { | |
return 42; | |
} | |
// "my" strlen | |
echo strlen('lala'), "\n"; | |
// global strlen | |
echo \strlen('lala'), "\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment