Req #44448 [Opn->Fbk]: base class constructor will remain unaffected by calling an successor obj.

From: Date: Sun, 02 Nov 2014 01:14:49 +0000
Subject: Req #44448 [Opn->Fbk]: base class constructor will remain unaffected by calling an successor obj.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-188414@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=44448&edit=1

 ID:                 44448
 Updated by:         requinix@php.net
 Reported by:        office at bas-x dot de
 Summary:            base class constructor will remain unaffected by
                     calling an successor obj.
-Status:             Open
+Status:             Feedback
 Type:               Feature/Change Request
-Package:            Feature/Change Request
+Package:            *General Issues
 Operating System:   Windows XP
 PHP Version:        5.2.5
 Block user comment: N
 Private report:     N

 New Comment:

I can't figure out what this is trying to ask for. Parent constructor isn't called if the
child doesn't call it explicitly? Yes it is. Can't access $this->test in the child?
Correct because it's a private property of the parent.


Previous Comments:
------------------------------------------------------------------------
[2008-03-16 17:26:06] office at bas-x dot de

Description:
------------
Obviously, the constructor of a base class will remain unaffected when calling an successor object.
It should be a very essential feature.
Because, also base classes maybe needs private initiations.


Reproduce code:
---------------
Class Base
{
    private $test;
    function __construct ( $moduleData ) 
    {              
       $test = "Hello World";
    }
}

Class Successor extends Base
{
      echo $this->test;
}






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



--
Edit this bug report at https://bugs.php.net/bug.php?id=44448&edit=1


Thread (3 messages)

« previous php.bugs (#188414) next »