class Converter {
public function convertDate($date) {
....
}
}
function convert($rawData, callable $convertMethod) {
return $convertMethod($rawData);
}
// Использование
$converter = new Converter;
$data = convert($rawData, $converter::convertDate)
class cat {
function say() {
echo 'meow' . PHP_EOL;
}
}
class dog {
function say() {
echo 'woof' . PHP_EOL;
}
}
call_user_func([dog, 'say']);
call_user_func(dog . '::say');
$cat = new cat();
call_user_func([$cat, 'say']);