3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Base{ function checkMethod(){ var_dump(method_exists($this, 'foo')); } } class Child extends Base{ function foo() { } } $base = new base(); $base->checkMethod(); $child = new Child(); $child->checkMethod();

preferences:
63.78 ms | 402 KiB | 5 Q