Skip to content

Instantly share code, notes, and snippets.

@CrBoy
Created June 27, 2012 13:19
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 CrBoy/3004013 to your computer and use it in GitHub Desktop.
Save CrBoy/3004013 to your computer and use it in GitHub Desktop.
PHP magic function __call example
<?php
class MyClass
{
public function __construct()
{
}
public function __call($name, $args)
{
echo "You called method \"$name\", and the args is:\n";
var_dump($args);
}
}
$c = new MyClass();
$c->a();
$c->f('a', 'b', 'c');
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment