Skip to content

Instantly share code, notes, and snippets.

@phpfiddle
Created May 2, 2017 08:46
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 phpfiddle/c317dfe60b04bf2f7a4aca76e9d9be60 to your computer and use it in GitHub Desktop.
Save phpfiddle/c317dfe60b04bf2f7a4aca76e9d9be60 to your computer and use it in GitHub Desktop.
[ Posted by Trungkienpvt ] Example for magic method
<?php
//magic method
class Foo
{
public function __call($method, $arguments)
{
echo "Called $method","\n";
}
static public function __callStatic($method, $arguments)
{
echo "Called $method","\n";
}
}
Foo::someStaticMethod();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment