Bug #11973 Updated: Parent's constructor uncallable directly from within child's methods.

From: Date: Mon, 09 Jul 2001 13:16:50 +0000
Subject: Bug #11973 Updated: Parent's constructor uncallable directly from within child's methods.
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-59313@lists.php.net to get a copy of this message
ID: 11973
Updated by: brianlmoon
Reported By: ori@corky.net
Old Summary: Parent's constructor uncallable directly from within child's methods.
Old Status: Open
Status: Bogus
Bug Type: Class/Object related
Operating System: Windows 2000 Professional
PHP Version: 4.0.5
New Comment:

Try $this->A();

Brian.

Previous Comments:
------------------------------------------------------------------------

[2001-07-09 07:43:58] ori@corky.net

Calling a parent class's constructor from a child's method does not work without the
parent:: operator, although the parent's constructor is listed in the child's list of
method as reported by get_class_methods().

Example script:

<?PHP

class A
{
    function A()
    {
    }
}
class B extends A
{
    function foo()
    {
        A();
    }
}
$obj = new B;
$obj->foo();

?>

------------------------------------------------------------------------



ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=11973&edit=1



Thread (2 messages)

« previous php.dev (#59313) next »