<?php
class MyParent {
public function whoami() {
echo get_class($this);
}
}
class MyChild extends MyParent {
public function whoami() {
echo "Don't call me now!";
parent::whoami();
}
}
$m = new reflectionMethod('MyParent', 'whoami');
$m->invoke(new MyChild);