RE: [PHP-DEV] [patch] Late static bindings (LSB)

From: Date: Fri, 21 Sep 2007 18:21:01 +0000
Subject: RE: [PHP-DEV] [patch] Late static bindings (LSB)
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-32417@lists.php.net to get a copy of this message
>__CLASS__ returns name of the class, get_parent_class() is the name of 
>parent class, those are entirely different things, nothing to do with 
>compiler/run time. Class always has one name and one parent or none.

Sorry, I meant:
__CLASS__
and
get_class($this)
They are both different things, and they can return different values. 
Like someone said it earlier, __CLASS__ is deterministic: you know its value
at compile.
get_class($this) is not : you cannot guess its value before run time.


>What do you mean by "RELATIVE"?

I mean, when you want to go upwards, to reach an ancestor class.
I think there is an ambiguity: for you, ::parent always means the parent of
__CLASS__
But it could also mean: the parent of "get_class($this)", in the mind of a
programmer.
And under certain conditions, like the one I explained, you cannot use
parent:: for that ; I must use a lot of "get_class()" and laborious
turnarounds to get what I want.

Baptiste


Thread (54 messages)

« previous php.internals (#32417) next »