On 31 Jan 2006, at 13:52, David Grant wrote:

Drop __construct, PHP5 will call Test() anyway.

From http://uk.php.net/manual/en/language.oop5.decon.php:

"For backwards compatibility, if PHP 5 cannot find a __construct()
function for a given class, it will search for the old-style constructor
function, by the name of the class."

Sure, if you're planning on writing 'backwards' code for ever more... For maximum efficiency in PHP5, do it this way around:

class test{
        function Test(){
                $this->__construct()
                //This will be called in PHP4
        }
        function __construct(){
                //This will be called in PHP5
        }
}

Why penalise the platform you're intending to run it on?

Marcus
--
Marcus Bointon
Synchromedia Limited: Putting you in the picture
[EMAIL PROTECTED] | http://www.synchromedia.co.uk

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

Reply via email to