note 107232 added to language.oop5.visibility

From: Date: Mon, 23 Jan 2012 13:10:25 +0000
Subject: note 107232 added to language.oop5.visibility
Groups: php.notes php.notes 
Request: Send a blank email to php-notes+get-185714@lists.php.net to get a copy of this message
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 ---- Server IP: 69.147.83.197 Probable Submitter: 4.59.160.2 ---- Manual Page -- http://www.php.net/manual/en/language.oop5.visibility.php Edit -- https://master.php.net/note/edit/107232 Del: integrated -- https://master.php.net/note/delete/107232/integrated Del: useless -- https://master.php.net/note/delete/107232/useless Del: bad code -- https://master.php.net/note/delete/107232/bad+code Del: spam -- https://master.php.net/note/delete/107232/spam Del: non-english -- https://master.php.net/note/delete/107232/non-english Del: in docs -- https://master.php.net/note/delete/107232/in+docs Del: other reasons-- https://master.php.net/note/delete/107232 Reject -- https://master.php.net/note/reject/107232 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#185714) next »