Re: PHP4 vs PHP5 classes

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

 



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.)

-- 
Larry Garfield
larry@xxxxxxxxxxxxxxxx

-- 
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