3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Base { function func() { echo " Base"; } function parent() { echo " None"; } } class Extended extends Base { function Func() { echo " Extended"; } function Parent() { echo parent::func(); } } class Extended2 extends Extended { function func() { echo " Extended2"; } function parent() { echo parent::Func(); } function grandpa() { echo parent::parent(); } } $var1 = new Base(); $var2 = new Extended(); $var3 = new Extended2(); $var1->func(); $var2->func(); $var3->func(); $var2->parent(); $var3->parent(); $var3->grandpa();
Output for 4.3.0 - 7.1.0
Base Extended Extended2 Base Extended Base