3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $test = new class { public $a; public $b = null; public $c = ""; public function execute($name) { var_dump($a[$name] = $name); var_dump($b[$name] = $name); var_dump($c[$name] = $name); } }; $test->write([1,2,3]); $test->write("test"); $test->write(123456);
based on vMRt3
Output for 7.0.0 - 7.3.0alpha1
Fatal error: Uncaught Error: Call to undefined method class@anonymous::write() in /in/a4T3V:15 Stack trace: #0 {main} thrown in /in/a4T3V on line 15
Process exited with code 255.
Output for 5.6.0 - 5.6.28
Parse error: syntax error, unexpected 'class' (T_CLASS) in /in/a4T3V on line 2
Process exited with code 255.