- is_callable: documentation ( source)
<?php
class Foo {
public function bar() {
// Do something conditionally if a child class has implemented a certain method.
if (is_callable('static::methodName')) {
static::methodName();
}
}
}
(new Foo())->bar();