Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class MyBaseClass {
- public static function __callStatic($what, $args)
- {
- return 'static call';
- }
- public function __call($what, $args)
- {
- return 'dynamic call';
- }
- }
- class ProxyClass extends MyBaseClass {
- //"Empty" class
- }
- class MyDerivedClass extends MyBaseClass {
- function someAction()
- {
- return ProxyClass::Foo();
- }
- }
- $bar = new MyDerivedClass();
- var_dump($bar->someAction()); //outputs 'static call'
- /*
- user@host ~ $ php test.php
- string(13) "static call"
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement