Created
December 30, 2010 06:56
-
-
Save hiromi2424/759536 to your computer and use it in GitHub Desktop.
dynamic call static method
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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