Re: PHP4 vs PHP5 classes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2008-07-30 at 01:16 -0500, Larry Garfield wrote:
> On Wednesday 30 July 2008 12:44:46 am Robert Cummings wrote:
> 
> > It's unfortunate that PHP5 decided to throw a Strict Standards exception
> > when you include both style constructors. For instance, I'm certain at
> > one point the following was recommended:
> >
> > <?php
> > class Foo
> > {
> >     function __construct()
> >     {
> >     }
> >
> >     function Foo()
> >     {
> >         self::__construct();
> >     }
> > }
> > ?>
> >
> > This was perfectly compatible with PHP5 and gave precedence to the PHP5
> > constructor style. Somewhere along the line though PHP5 started
> > spouting:
> >
> >     Strict Standards: Redefining already defined constructor
> >
> > So I just completely removed the PHP5 style constructors from my code
> > and use the PHP4 style since then there are no exceptions. Mark my words
> > though... at some point PHP will start spewing an E_DEPRECATED for PHP4
> > style constructor *lol*.
> >
> > Cheers,
> > Rob.
> 
> Well, since PHP 4 has been officially retired as of the start of this year and 
> the final-forever release of PHP 4 (4.4.9) is due by 08/08/08, I don't think 
> that's much of an issue.  If you're still coding to PHP 4, you're pretty much 
> on your own and need to move into this century.
> 
> Especially given the different way objects are handled between PHP 4 and PHP 
> 5, trying to support a dead version of PHP is simply not worth the effort.  
> Go PHP 5 and don't look back.  (And if you're on a web host that is still on 
> PHP 4, I recommend you switch to a web host that is not doomed to go out of 
> business within the next year, because I predict it will.)

My code works fine in PHP5, it has worked fine since before PHP5
launched an official version. That said, I do still code to PHP4
compatibility... and I am certainly NOT alone. Also, for what it's
worth, at one point in "this century" PHP4 was the only option since
PHP5 was released mid 2004, therefore there is nothing about this
century that makes it the exclusive territory of PHP5. Moving along
though, it's also worth noting, that web hosts worth their salt, provide
access to both PHP4 AND PHP5 thus allowing the use of whichever version
their customers damn well please. And I will bet you a hundred bucks
there will still be PHP4 hosts in existence in another year.

http://www.nexen.net/images/stories/phpversion/200804/evolution.milieu.en.png

In April (yes I know it's now July) PHP4 was still kicking PHP5's ass.
Not bad for a dead version.

And before anyone gets their panties in a bunch, I'm not advocating
picking up and starting to work with PHP4. But I'm certainly not so full
of hubris to think just because someone said jump (or GOPHP5 if you
will) that every Bill, Bob, and Betty on the Intertubes is going to
switch from PHP4 to PHP5. There's a very real cost to switching, and if
it isn't necessary then (speaking frankly) fuckit!

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux