new construct
| From: | michel 'ziobudda' morelli | Date: | Tue, 25 Feb 2003 16:06:56 +0000 |
| Subject: | new construct | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-94559@lists.php.net to get a copy of this message | ||
Hi, I need to know which is the correct new construct: class_name or
__construct.
>From Zend_Changes:
The Zend Engine 2.0 introduces a standard way of declaring
constructor methods by calling them by the name __construct().
...
For backwards compatibility, if the Zend Engine 2.0 cannot find
a __construct() function for a given class, it will search for
the old-style constructor function, by the name of the class.
But:
<?php
class A {
function __construct()
{
echo "into A::__construct()";
}
function A()
{
echo "into A::A()";
}
}
$a = new A;
?>
and "/usr/local/php5-230202003/bin/php test.php" give this result:
into A::A()
And this is not correct, or not ?
tnx
--
michel 'ziobudda' morelli <michel@ziobudda.net>