Re: PHP4 vs PHP5 classes

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

 



Chris wrote:
Don't forget that in PHP5, the constructor named has changed.  In PHP4
it called a method with the same name as the class.  But, in PHP5, it
looks for __construct() instead.

If __construct doesn't exist then it falls back to the php4 way - makes
it backwards compatible :)


But, if people want to code to php5 standards and beyond, then I would recommend always using the __construct() method to construct your class. Then make it work in php4. Not the other way around.

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