3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $foo = []; $obj = new class { public function __construct() { var_dump($foo); } };
based on YbOWi
Output for 7.0.28 - 7.3.0rc3
Notice: Undefined variable: foo in /in/pI4RI on line 7 NULL
Output for 5.6.38
Parse error: syntax error, unexpected 'class' (T_CLASS) in /in/pI4RI on line 5
Process exited with code 255.