3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $i = 1; var_dump(new class($i) { public function __construct($i) { $this->i = $i; } });
based on hjGNi
Output for 7.0.0 - 7.3.0
object(class@anonymous)#1 (1) { ["i"]=> int(1) }
Output for hhvm-3.21.0 - 3.22.0
object(class@anonymous$;4)#1 (1) { ["i"]=> int(1) }
Output for hhvm-3.17.3 - 3.20.2
object(class@anonymous$;2)#1 (1) { ["i"]=> int(1) }
Output for hhvm-3.11.1 - 3.15.4
object(class@anonymous$;909375913)#1 (1) { ["i"]=> int(1) }
Output for hhvm-3.10.1
Fatal error: syntax error, unexpected T_CLASS, expecting '[' or '{' in /in/N4JLB on line 3
Process exited with code 255.
Output for 5.4.0 - 5.6.38
Parse error: syntax error, unexpected 'class' (T_CLASS) in /in/N4JLB on line 3
Process exited with code 255.
Output for 5.3.18 - 5.3.29
Parse error: syntax error, unexpected T_CLASS in /in/N4JLB on line 3
Process exited with code 255.