3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Tmp { function t() { echo 'Parent'; } } class TmpTwo { function t() { parent :: tmp(); } } (new TmpTwo)->t();
Output for 7.0.0 - 7.2.6
Fatal error: Uncaught Error: Cannot access parent:: when current class scope has no parent in /in/pFeCs:4 Stack trace: #0 /in/pFeCs(6): TmpTwo->t() #1 {main} thrown in /in/pFeCs on line 4
Process exited with code 255.
Output for hhvm-3.15.4
Fatal error: Uncaught Error: Cannot access parent:: when current class scope has no parent in /in/pFeCs:4 Stack trace: #0 /in/pFeCs(6): TmpTwo->t() #1 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Fatal error: Cannot access parent:: when current class scope has no parent in /in/pFeCs on line 4
Process exited with code 255.