Skip to content

Instantly share code, notes, and snippets.

@dave1010
Created April 2, 2014 08:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dave1010/9929924 to your computer and use it in GitHub Desktop.
Save dave1010/9929924 to your computer and use it in GitHub Desktop.
magic class alias
<?php
class Magic {public function __call($metod, $args=null){return $this;}}
spl_autoload_register(function($c) {
eval("class $c extends Magic {};");
});
(new Foo)->bar()->baz();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment