[KLUG Programming] Subtley *NASTY* PHP4/5 Difference
Robert G. Brown
bob at whizdomsoft.com
Thu Apr 7 21:51:09 EDT 2005
On Thu, 07 Apr 2005 21:12:02 -0400, Jamie McCarthy wrote:
>adam at morrison-ind.com (Adam Tauno Williams) writes:
>
>> a switch that disposes of objects based upon their type (pretty
>> common I suppose)
>I thought being able to avoid exactly that was the major selling
>point of object-oriented code. Why can't each class know how to
>dispose of its own objects?
A destructor can be defined... because in practice terminating the life
of an object may have side-effects, some of which can be really unplesent.
It's more important in languages that use pointers, and implementation that
have sorta passive memery management schemes at run-time (most C++'s are
like that). However, even really formal guys like Meyer implant the notion
of a destructor in OO langugaes (in his case, Eiffel).
>> PHP4 lowercases all object/type names... while PHP5 seems to
>> retains all case on object/type names
>One more thing to throw on the pile :)
Which pile? There seems to be a lot of them! :)
I don't remember what PHP3 did.. anyone out there who does, please
don't be shy!
My REAL question is whether this is a change in the LANGUAGE or
a "mere defect" in IMPLEMENATION. As defects go, it would be a doozy,
and I don't like to see flip-flopping on something so important.
>http://tnx.nl/php
I'd like to see the languages any of these guys wrote. Withut prejudice to
any "side" in these discussions, it's a very instructive exercise, and provides
a different perspective.
Regards,
---> RGB <---
More information about the Programming
mailing list