Can someone explain me why i'm getting the results as below? (look at the comments).
class A {
public function foo() { // foo from B
//private function foo() { // foo from A
echo "foo from A</br>";
}
public function test() {
$this->foo();
}
}
class B extends A {
public function foo() {
echo "foo from B</br>";
}
}
$b = new B();
$b->test();
Shouldn't i always get "foo from B" while "this" pointing to class B object?