3v4l.org

run code in 300+ PHP versions simultaneously
<?php class C { public function f() { echo "In f\n"; } public static function __callStatic($method, $params) { $o = new static; echo "In callStatic\n"; return call_user_func_array(array($o, $method), $params); } public function x() { echo "In X\n"; } C::f(); C::x();
Output for 5.4.0 - 5.4.22
Parse error: syntax error, unexpected 'C' (T_STRING), expecting function (T_FUNCTION) in /in/tVMh8 on line 15
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_STRING, expecting T_FUNCTION in /in/tVMh8 on line 15
Process exited with code 255.

preferences:
179.93 ms | 1395 KiB | 58 Q