class Test {
static $data = array();
public static function __callStatic($name, $params) {
$propName = substr($name, 3);
if (substr($name, 0, 3) == "set") {
return static::$data[$propName] = $params[0];
}
return static::$data[$propName];
}
}
Test::setMyName("Bob");
Test::getMyName(); //Bob