3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Base { public static function __callStatic($method, $args) { if ($method == 'new') echo 'Base::new() called successfully'; } public function __call($method, $args) { if ($method == 'new') echo '$base->new() called successfully'; } } $base = Base::new(); call_user_func(array('Base', 'new'); $base = new Base; $base->new();
based on D7nhN
Output for 7.0.0 - 7.0.2
Parse error: syntax error, unexpected ';', expecting ',' or ')' in /in/FYdup on line 15
Process exited with code 255.
Output for 5.5.24 - 5.6.17
Parse error: syntax error, unexpected 'new' (T_NEW) in /in/FYdup on line 14
Process exited with code 255.
Output for 5.4.11 - 5.4.45
Parse error: syntax error, unexpected 'new' (T_NEW), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /in/FYdup on line 14
Process exited with code 255.
Output for 5.3.21 - 5.3.29
Parse error: syntax error, unexpected T_NEW, expecting T_STRING or T_VARIABLE or '$' in /in/FYdup on line 14
Process exited with code 255.