Advertisement
dsda

Untitled

Apr 27th, 2013
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.40 KB | None | 0 0
  1. namespace foo {
  2.     function testFunc($message) {
  3.         echo 'foo testFunc with '.$message;
  4.     }
  5. }
  6.  
  7.  
  8. namespace bar {
  9.     function testFunc($message) {
  10.         callMethod('foo','testFunc',$message);
  11.     }
  12. }
  13.  
  14. namespace {
  15.     function callMethod($namespacename,$methodname,$arguments=NULL) {
  16.         $nsFunc = '\\'.$namespacename.'\\'.$methodname;
  17.         $nsFunc($arguments);
  18.     }
  19.     callMethod('bar','testFunc','Cool it work!!!');
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement