When you extend a class, the child inherits the properties by copy pasting those (new variables, same values), therefore consuming more memory, or… references them?
Hope I’ve made myself clear.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’m going to assume you’re referring to zvals, rather than common variable referencing. In that case, yes, it does appear that the inherited property is just an internal reference up until the point you change the value in your extended object. For more info, see the manual: http://www.php.net/manual/en/features.gc.refcounting-basics.php
An example:
Results: