Skip to content

Instantly share code, notes, and snippets.

@ddeaguiar
Created March 15, 2010 15:04
Show Gist options
  • Save ddeaguiar/332919 to your computer and use it in GitHub Desktop.
Save ddeaguiar/332919 to your computer and use it in GitHub Desktop.
<?php
class Foo {
function __construct($method) {
$this->$method = create_function('', 'print "foobar";');
}
public function __call($name, $arguments) {
call_user_func($this->$name, $arguments);
}
}
$f = new Foo('my_method');
$f->my_method();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment