php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #44448 base class constructor will remain unaffected by calling an successor obj.
Submitted: 2008-03-16 17:26 UTC Modified: 2014-12-30 10:41 UTC
From: office at bas-x dot de Assigned:
Status: No Feedback Package: *General Issues
PHP Version: 5.2.5 OS: Windows XP
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: office at bas-x dot de
New email:
PHP Version: OS:

 

 [2008-03-16 17:26 UTC] 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;
}





Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-11-02 01:14 UTC] requinix@php.net
-Status: Open +Status: Feedback -Package: Feature/Change Request +Package: *General Issues
 [2014-11-02 01:14 UTC] requinix@php.net
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.
 [2014-12-30 10:41 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 13:01:31 2024 UTC