note 107232 deleted from language.oop5.visibility by danbrown
| From: | danbrown@php.net | Date: | Thu, 10 May 2012 21:36:47 +0000 |
| Subject: | note 107232 deleted from language.oop5.visibility by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-187914@lists.php.net to get a copy of this message | ||
Note Submitter: andrew dot feller at gmail dot com
----
PHP does not follow Java's "Hiding Variables"[1] technique of overriding public /
protected class variables but extends these variables into subclasses as normal.
As mentioned by Mike Lively[2]:
" ... when you redeclare protected and public variables in PHP new spaces in memory are not
created, it essentially uses the same space previously occupied by your parent classâ
variables. This is not true however for private variables. They will get their own distinct
spaces."
REFERENCES
1. http://docs.oracle.com/javase/tutorial/java/IandI/hidevariables.html
2. http://michaelkimsal.com/blog/ppp-php-question-v2-the-humbler-post/comment-page-1/#comment-61325