foo; } } '); $tmp = new class() extends foo { function baz() { // step into this. $this->bar(); } }; $tmp->baz();