3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo { public function bar() { echo parent::bar(); } } $f = new Foo; $f->bar();
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Cannot access parent:: when current class scope has no parent in /in/EecGs:5 Stack trace: #0 /in/EecGs(10): Foo->bar() #1 {main} thrown in /in/EecGs on line 5
Process exited with code 255.
Output for 5.3.20 - 5.6.21
Fatal error: Cannot access parent:: when current class scope has no parent in /in/EecGs on line 5
Process exited with code 255.