On Mar 21, 2007, at 7:14 PM, Chris wrote:

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.

Ah, yes, looking back I can see how his statement was ambiguous.

erik jones <[EMAIL PROTECTED]>
software developer
615-296-0838
emma(r)



Reply via email to