You can play with __ callStatic () and do something like this:
class testObj {
public function __construct() {
}
public static function __callStatic($name, $arguments) {
$name = substr($name, 1);
if(method_exists("testObj", $name)) {
echo "Calling static method '$name'<br/>";
call_user_func_array(array("testObj", $name), $arguments);
}
}
static public function test($n) {
echo "n * n = " . ($n * $n);
}
}
testObj::_test(20);
testObj::test(20);
, , "_", "".
, __callStatic, .
!