At 16:46 23.02.2003, michel 'ziobudda' morelli wrote:
Hi, why if I have

class B extends A {
}

the only way to call in automatic the A::__construct() is to not write
the B::__construct() ?

Ok, this is the design of PHP. But why ?

You can do the following: class base { function __construct() { echo "base::__construct()\n"; }

        function __destruct() {
                echo "base::__destruct()\n";
        }
}

class derived extends base {
        function __construct() {
                parent::__construct();
                echo "derived::__construct()\n";
        }

        function __destruct() {
                parent::__destruct();
                echo "derived::__destruct()\n";
        }
}

See:
http://marcus-boerger.de/php/ext/ze2/ctor_dtor_inheritance.phpt.txt

regards
marcus




-- ---------------------------------------------------------------------- Marcus Börger - Looking for all sorts of freelance work - just ask...

Did i help you? Consider a gift:
http://www.amazon.de/exec/obidos/wishlist/ho722v0rg1u0
----------------------------------------------------------------------


-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to