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(); ?>
Output for 5.4.0 - 5.4.7
Parse error: syntax error, unexpected 'new' (T_NEW), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in n6DKZ on line 13
Process exited with code 255.
Output for 5.3.0 - 5.3.17
Parse error: syntax error, unexpected T_NEW, expecting T_STRING or T_VARIABLE or '$' in n6DKZ on line 13
Process exited with code 255.