Re: Re: _Construct question

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

 



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/

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