note 86159 added to language.oop5.visibility

From: Date: Mon, 06 Oct 2008 11:33:06 +0000
Subject: note 86159 added to language.oop5.visibility
Groups: php.notes 
Request: Send a blank email to php-notes+get-145085@lists.php.net to get a copy of this message
PHP 5.2.3, windows The comment in this example is invalid <?php /** * Define MyClass2 */ class MyClass2 extends MyClass { // We can redeclare the public and protected method, but not private protected $protected = 'Protected2'; function printHello() { echo $this->public; echo $this->protected; echo $this->private; } } ?> Just try this: <?php class MyClass2 extends MyClass { // We CAN redeclare the public, protected and private PROPERTIES in this example public $public = 'Public2'; protected $protected = 'Protected2'; private $private = 'Private2'; function printHello() { echo $this->public; echo $this->protected; echo $this->private; } } ?> ---- Server IP: 91.196.196.241 Probable Submitter: 212.15.152.123 ---- Manual Page -- http://www.php.net/manual/en/language.oop5.visibility.php Edit -- https://master.php.net/note/edit/86159 Del: integrated -- https://master.php.net/note/delete/86159/integrated Del: useless -- https://master.php.net/note/delete/86159/useless Del: bad code -- https://master.php.net/note/delete/86159/bad+code Del: spam -- https://master.php.net/note/delete/86159/spam Del: non-english -- https://master.php.net/note/delete/86159/non-english Del: in docs -- https://master.php.net/note/delete/86159/in+docs Del: other reasons-- https://master.php.net/note/delete/86159 Reject -- https://master.php.net/note/reject/86159 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#145085) next »