3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo { public static function new() : self { return new self(func_get_args()); } } var_dump(Foo::new());
Output for hhvm-3.11.1 - 3.17.3, 7.0.0 - 7.2.0
object(Foo)#1 (0) { }
Output for hhvm-3.10.1
Fatal error: Syntax only allowed in Hack files (<?hh) or with -v Eval.EnableHipHopSyntax=true in /in/CCT5I on line 4
Process exited with code 255.
Output for 5.5.0 - 5.6.30
Parse error: syntax error, unexpected 'new' (T_NEW), expecting identifier (T_STRING) in /in/CCT5I on line 4
Process exited with code 255.