|
Posted by Jochem Maas on 01/21/05 12:56
Tbird switched the reply and reply-all buttons again ;-)...
> ?>
> IMHO its normally to use access type for methods declaration in interfaces. Why not?
> Maybe my first example was not sufficiently illustrative. But my question was "why it does not work in one environment and work fine in another".
it worked for a while because it was originally overlooked, then they
'fixed' it. -- you may not agree with the devs.
> The problem has acquired when i try to add "static" in my interface definition. I don't think that this is a bug in PHP.
> I just want to be deep insight in OOP of PHP5 engine.
>
your right, its not a bug - although some have argued that its Sucks(tm).
in short it was decided by the devs that interfaces are not meant for
static classes, they only apply to objects - which is why 'static' is
not (no longer) allowed on interface methods. if you want to know more
then digging into the php internals mailing list archives will give you
long discussions and justifications as to why it works they way it does.
if you think about it you can see where they are coming from: passing
around classes (i.e. classNames) and then checking whether said class
implements something is really odd, instead you pass around objects.
or more simply:
class == blueprint
object == house
you can interface with a house (lets hope your house IMPLEMENTS a door
interface!) but you can't interface with a blueprint (possibly with the
piece of paper it may be printed on but not with the actual blueprint)
because the blueprint is an idea/concept.
hope that helps you to understand the rationale.
rgds,
JOchem
>
....
>
Navigation:
[Reply to this message]
|