Re: Re: _Construct question

From: Date: Thu, 22 Mar 2007 00:14:17 +0000
Subject: Re: Re: _Construct question
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-251059@lists.php.net to get a copy of this message
Erik Jones wrote:
That's not true, running with v. 5.2.1: <?php class A {
    function A() {
        echo "works\n";
    }
} $a = new A(); ?> Outputs: works On Mar 21, 2007, at 8:06 AM, itoctopus wrote:
They're basically the same thing, however, you can only use __construct in PHP5.
He meant that __construct() doesn't work in php4. It's only available in php5. php5 does this: Is the function __construct available? - Yes? Use it. - No? Look for a function with the same name as the class. If that's available, use it. So it's backwards compatible. -- Postgresql & php tutorials http://www.designmagick.com/

« previous php.general (#251059) next »