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 FYdup
Output for 7.0.0 - 7.2.0
Base::new() called successfullyBase::new() called successfully$base->new() called successfully
Output for 5.5.24 - 5.6.28
Parse error: syntax error, unexpected 'new' (T_NEW) in /in/clKJj 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/clKJj 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/clKJj on line 14
Process exited with code 255.