3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $x = @new class { public function __construct($a) {} }; var_dump($x);
based on jReAJ
Output for 7.1.0 - 7.2.0
Fatal error: Uncaught ArgumentCountError: Too few arguments to function class@anonymous::__construct(), 0 passed in /in/b1QBF on line 3 and exactly 1 expected in /in/b1QBF:4 Stack trace: #0 /in/b1QBF(3): class@anonymous->__construct() #1 {main} thrown in /in/b1QBF on line 4
Process exited with code 255.
Output for 7.0.0 - 7.0.20
object(class@anonymous)#1 (0) { }
Output for 5.4.0 - 5.6.28
Parse error: syntax error, unexpected 'class' (T_CLASS) in /in/b1QBF on line 3
Process exited with code 255.
Output for 5.3.19 - 5.3.29
Parse error: syntax error, unexpected T_CLASS in /in/b1QBF on line 3
Process exited with code 255.