feyd wrote:Trick question. It'll do neither.
You've only called test() in CChild.
Doh!!!
Not a trick question, I just forgot something:
CChild::test() is supposed to call parent::test()
I'm curious to see how PHP 5 object model deals with $this pointer inside parent functions.
In my version: 4.2.3 PHP object model creates only a single object instance for any number of parent classes derived from.
What this means is, if I need the name of a class dynamically, say at the root class which is 3 classes deep, I'm SOL because get_class($this) returns the name of the aggregate object, regardless of where I am in the hierarchy I get this same result.
__CLASS__ was introduced only in 4.3.0 so my version ain't there yet

and I like to develop for the lowest common denominator
Thus the curiosity of how PHP5 handles this scenario
