3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = new class extends \DOMDocument { private $foo; public function getFoo() { if ($this->foo !== null) { print "woohoo"; } } }; var_dump($a->getFoo());
based on oc9An
Output for hhvm-3.18.5 - 3.22.0, 7.0.30 - 7.3.0rc3
NULL
Output for 5.6.30
Parse error: syntax error, unexpected 'class' (T_CLASS) in /in/18JH7 on line 3
Process exited with code 255.