3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(-1); class B { function myfunction($var = "default") { echo $var; } } class C extends B { function myfunction() { echo "myfunction"; } } $c = new C(); $c->myfunction(); $b = new B(); $b->myfunction();

preferences:
41.53 ms | 402 KiB | 5 Q