Advertisement
Guest User

Untitled

a guest
Sep 5th, 2015
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. <?php
  2.  
  3. function foobar($arg1, $arg2)
  4. {
  5. echo __FUNCTION__ . " got $arg1 and $arg2\n";
  6. }
  7.  
  8. class foo
  9. {
  10. function bar($arg1, $arg2)
  11. {
  12. echo __METHOD__ . " got $arg1 and $arg2\n";
  13. }
  14. }
  15.  
  16. call_user_func_array('foobar', ['one', 'tow']);
  17.  
  18. $foo = new foo;
  19. call_user_func_array([$foo, 'bar'], ['one', 'two']);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement