Possible Duplicate:
Why is my constructor still called even if the class and constructor case are different?
<?php
abstract class foo {
function foof() {
echo "Hello, I'm foo :)";
}
}
class foo2 extends foo {
function foo2f() {
$this->foof();
}
}
class foo3 extends foo2 {
function foo3f() {
$this->foo2f();
}
}
$x = new foo3;
$x->foo3f();
?>
This code outputs "Hello, I'm foo :)" (as expected) but when I change code to something like this: http://pastebin.com/wNeyikpq
<?php
abstract class foo {
function fooing() {
echo "Hello, I'm foo :)";
}
}
class foo2 extends foo {
function foo2() {
$this->fooing();
}
}
class foo3 extends foo2 {
function foo3() {
$this->foo2();
}
}
$x = new foo3;
$x->foo3();
?>
PHP prints:
Hello, I'm foo :)Hello, I'm foo :)
Why? Is it a bug?