Re: Re: Are PHP5 features worth it?
| From: | Larry Garfield | Date: | Wed, 20 Dec 2006 03:18:02 +0000 |
| Subject: | Re: Re: Are PHP5 features worth it? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-246051@lists.php.net to get a copy of this message | ||
On Tuesday 19 December 2006 19:24, Tony Marston wrote:
> I have written a large application which uses the OO features of PHP 4, and
> the same code runs untouched with PHP 5. There is no advantage in making
> use of some of these fancy new features in PHP 5, so I just don't bother.
I couldn't disagree more. While I've yet to write any exception-based code,
for me the magic getter/setter functionality in PHP 5's OOP is reason enough
to switch all on its own. Even if you don't want to write Java-style OO with
crazy nested hierarchies (which you shouldn't be doing in PHP), true
Singletons can be quite nice. The simplicity offered by passing objects as
references is nice. There's a lot more to PHP 5's OOP than just "let's add
exceptions because Java has them", and that's not even counting the non-OOP
improvements.
Your point falls flat anyway. Yes, most PHP 4 code will keep on humming in
PHP 5. That doesn't mean the PHP 5 features have "no advantage", it just
means that they're not mandatory for code to work in PHP 5. There's plenty
that you can do in PH P 5 that you couldn't do in PHP 4, but if all you know
is PHP 4 then you don't know what they are yet. Your argument is logically
false.
--
Larry Garfield AIM: LOLG42
larry@garfieldtech.com ICQ: 6817012
"If nature has made any one thing less susceptible than all others of
exclusive property, it is the action of the thinking power called an idea,
which an individual may exclusively possess as long as he keeps it to
himself; but the moment it is divulged, it forces itself into the possession
of every one, and the receiver cannot dispossess himself of it." -- Thomas
Jefferson