Bug #40283

New constructor in grandparent class not called

Added by Andreas Wolf over 9 years ago. Updated almost 9 years ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Object
Target version:
-
Start date:
2012-08-27
Due date:
% Done:

0%

Estimated time:
PHP Version:
Has patch:
No
Complexity:

Description

I have a class hierarchy like this:

SomeClass
 +-- SubclassA
 \-+ SubclassB
   \ SubclassBA

I inserted a new __construct() method in SomeClass. It was called without any problem from SubclassA, but not from SubclassBA, because the Proxies in Cache/Code/FLOW3_Object_Classes were not regenerated for SubclassB.

The call chain for SubclassBA::__construct() thus ended in SubclassB, because when the SubclassB proxy was generated, there was no constructor in SomeClass, hence no call to parent::__construct() was inserted into the SubclassB proxy (because it would have ended in a fatal error).

#1

Updated by Karsten Dambekalns over 9 years ago

  • Category set to Object

Also available in: Atom PDF