3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Object { function resetObject() { $blankInstance = new static; //requires PHP 5.3+ for older versions you could do $blankInstance = new get_class($this); $reflBlankInstance = new \ReflectionClass($blankInstance); foreach ($reflBlankInstance->getProperties() as $prop) { $prop->setAccessible(true); $this->{$prop->name} = $prop->getValue($blankInstance); } } }
Output for 7.2.0 - 7.3.0rc3
Fatal error: Cannot use 'Object' as class name as it is reserved in /in/SmH1F on line 3
Process exited with code 255.
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.1.20