speedmax (owner)

Revisions

gist: 128391 Download_button fork
public
Public Clone URL: git://gist.github.com/128391.git
Embed All Files: show embed
overload Object#send .php #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?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)
        }
   }
}
 
 
?>