Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace foo {
- function testFunc($message) {
- echo 'foo testFunc with '.$message;
- }
- }
- namespace bar {
- function testFunc($message) {
- callMethod('foo','testFunc',$message);
- }
- }
- namespace {
- function callMethod($namespacename,$methodname,$arguments=NULL) {
- $nsFunc = '\\'.$namespacename.'\\'.$methodname;
- $nsFunc($arguments);
- }
- callMethod('bar','testFunc','Cool it work!!!');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement