Skip to content

Instantly share code, notes, and snippets.

@kanonji
Created June 11, 2010 10:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kanonji/434334 to your computer and use it in GitHub Desktop.
Save kanonji/434334 to your computer and use it in GitHub Desktop.
<?php
class Foo{
public function call($call){
call_user_func(array($this, $call));
}
static public function publicmethod(){
echo __METHOD__;
}
static protected function protectedmethod(){
echo __METHOD__;
}
static private function privatemethod(){
echo __METHOD__;
}
}
$foo = new Foo();
$foo->call('publicmethod');
$foo->call('protectedmethod');
$foo->call('privatemethod');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment