Skip to content

Instantly share code, notes, and snippets.

@hiromi2424
Created December 30, 2010 06:56
Show Gist options
  • Save hiromi2424/759536 to your computer and use it in GitHub Desktop.
Save hiromi2424/759536 to your computer and use it in GitHub Desktop.
dynamic call static method
class StaticClass {
function hoge() {
echo 'hoge';
}
function piyo() {
echo 'piyo';
}
}
foreach (array('hoge', 'piyo') as $name) {
StaticClass::$name(); // ** Does this work any PHP >= 4 ??? **
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment