0

Is there any way to initialize a class public variable at the time of object creation. But the case is that I have a child class and I dont want to over ride the parent constrctor. So is there any way out or any function that will be called at the time of object implicitly.

Thanks In advance

3
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by digital-ether
0

Is there any way to initialize a class public variable at the time of object creation. But the case is that I have a child class and I dont want to over ride the parent constrctor. So is there any way out or any function that will be called at the time of object implicitly.

Thanks In advance

I don't think there is anything else called by the PHP engine during instantiation of a class except for the constructor.

I think the question is why you don't want to override the parent. If the child class calls the parents constructor within its own constructor, then its just like not overriding the parent, except that you have are few more function calls.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.