note 104843 added to language.oop5.visibility

From: Date: Sun, 10 Jul 2011 22:21:59 +0000
Subject: note 104843 added to language.oop5.visibility
Groups: php.notes 
Request: Send a blank email to php-notes+get-181408@lists.php.net to get a copy of this message
access a protected property: <?php //Some library I am not allowed to change: abstract class a { protected $foo; } class aa extends a { function setFoo($afoo) { $this->foo = $afoo; } } ?> if you get an instance of aa and need access to $foo: <?php class b extends a { function getFoo($ainstance) { return $ainstance->foo; } } $aainstance=someexternalfunction(); $binstance=new b; $aafoo=$binstance->getFoo($aainstance); ?> ---- Server IP: 69.147.83.197 Probable Submitter: 89.217.165.70 ---- Manual Page -- http://www.php.net/manual/en/language.oop5.visibility.php Edit -- https://master.php.net/note/edit/104843 Del: integrated -- https://master.php.net/note/delete/104843/integrated Del: useless -- https://master.php.net/note/delete/104843/useless Del: bad code -- https://master.php.net/note/delete/104843/bad+code Del: spam -- https://master.php.net/note/delete/104843/spam Del: non-english -- https://master.php.net/note/delete/104843/non-english Del: in docs -- https://master.php.net/note/delete/104843/in+docs Del: other reasons-- https://master.php.net/note/delete/104843 Reject -- https://master.php.net/note/reject/104843 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#181408) next »