3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class ParentClass { public static $prop; } class ChildClass extends Parent { } ParentClass::prop = "first"; $parent = new ParentClass; echo "parent 1: " . $parent::prop; ChildClass::prop = "second"; $child = new ChildClass; echo "child 1: " . $child::prop; echo "parent 2: " . $parent::prop;
Output for 5.5.0 - 5.5.12
Fatal error: Cannot use 'parent' as class name as it is reserved in /in/49P3W on line 7
Process exited with code 255.
Output for 5.3.0 - 5.4.28
Parse error: syntax error, unexpected '=' in /in/49P3W on line 11
Process exited with code 255.