Last active
December 22, 2015 07:59
-
-
Save mhulse/6441525 to your computer and use it in GitHub Desktop.
PHP simple utility class demo code.
This file contains hidden or 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
<?php | |
class Utility | |
{ | |
public static function foo($arg = '') { | |
echo sprintf('<p>This class is "%s"; it\'s method is "%s"; the arg is "%s"</p>', get_class($this), __FUNCTION__, $arg); | |
} | |
public static function bar($arg = '') { | |
echo sprintf('<p>This class is "%s"; it\'s method is "%s"; the arg is "%s"</p>', get_class($this), __FUNCTION__, $arg); | |
} | |
} | |
Utility::foo('Hello'); | |
Utility::bar('world'); | |
Utility::foo('!'); | |
/* | |
Output: | |
This class is "Utility"; it's method is "foo"; the arg is "Hello" | |
This class is "Utility"; it's method is "bar"; the arg is "world" | |
This class is "Utility"; it's method is "foo"; the arg is "!" | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Discussion here.