Created
June 12, 2009 02:34
-
-
Save speedmax/128391 to your computer and use it in GitHub Desktop.
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 Object { | |
function send($method) { | |
$args = func_get_args(); | |
$method = array_shift($args); | |
# Instace method call | |
if (isset($this)) { | |
return $this->$method(); | |
} | |
# class method call | |
elseif ($class = get_called_class()) { | |
return call_class_method($class, $method) | |
} | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment