[KLUG Programming] Subtley *NASTY* PHP4/5 Difference

Andrew Thompson tempes at ameritech.net
Fri Apr 8 02:43:19 EDT 2005


On Thu, 2005-04-07 at 21:51, Robert G. Brown wrote:
> 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!

Well, my PHP experience is still on the light side, but my impression of
objects in 3 and 4 has been they're basically fancy structures with
member functions, and that's about it. No provision for defining
destructors, nor access control to an object's "internal" elements; if
the class includes it, anything can screw with it. From what little I've
read, I get the impression that PHP5 has become rather more disciplined,
with provisions for those and other features. I think it might even have
a compiler now, though I'd have to check again. All in all, I've gained
the impression that PHP has matured considerably with version 5, which
in my opinion is mostly a Good Thing.

> 
> 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 <---
> 
> _______________________________________________
> Programming mailing list
> Programming at kalamazoolinux.org
> http://www.kalamazoolinux.org/mailman/listinfo/programming
-- 
Andrew Thompson <tempes at ameritech.net>
The Imagerie



More information about the Programming mailing list