Skip to content

Instantly share code, notes, and snippets.

@speedmax
Created June 12, 2009 02:34
Show Gist options
  • Save speedmax/128391 to your computer and use it in GitHub Desktop.
Save speedmax/128391 to your computer and use it in GitHub Desktop.
<?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