Skip to content

Instantly share code, notes, and snippets.

@kanonji
Created June 11, 2010 10:25
Show Gist options
  • 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