code_junkie

php: Calling Static Classes through a variable

Nov 13th, 2011
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.17 KB | None | 0 0
  1. $name = 'StaticClass';
  2. ($name)::foo();
  3.  
  4. $name::foo()
  5.  
  6. call_user_func(array($classname,$methodname))
  7.  
  8. $name = 'staticClass';
  9. user_call_func(array($name, 'foo'));
Add Comment
Please, Sign In to add comment