<?php
class MethodTest {
public function __call($name, $arguments) {
echo "Calling object method '$name' "
. implode(', ', $arguments). "\n";
}
public static function __callStatic($name, $arguments) {
echo "Calling static method '$name' "
. implode(', ', $arguments). "\n";
}
}
$obj = new MethodTest;
$obj->runTest('in object context');
MethodTest::runTest('in static context'); ?>
The above example will output:
Calling object method 'runTest' in object context
Calling static method 'runtest' in static context