cvs: phpdoc /en/language/oop5 visibility.xml

From: Date: Tue, 16 Oct 2007 10:00:15 +0000
Subject: cvs: phpdoc /en/language/oop5 visibility.xml
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-229@lists.php.net to get a copy of this message
rquadling Tue Oct 16 10:00:15 2007 UTC Modified files: /phpdoc/en/language/oop5 visibility.xml Log: Fix: #42984 - Corrected example. http://cvs.php.net/viewvc.cgi/phpdoc/en/language/oop5/visibility.xml?r1=1.12&r2=1.13&diff_format=u Index: phpdoc/en/language/oop5/visibility.xml diff -u phpdoc/en/language/oop5/visibility.xml:1.12 phpdoc/en/language/oop5/visibility.xml:1.13 --- phpdoc/en/language/oop5/visibility.xml:1.12 Wed Jun 20 22:24:13 2007 +++ phpdoc/en/language/oop5/visibility.xml Tue Oct 16 10:00:15 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.12 $ --> +<!-- $Revision: 1.13 $ --> <sect1 xml:id="language.oop5.visibility" xmlns="http://docbook.org/ns/docbook"> <title>Visibility</title> <para> @@ -21,20 +21,20 @@ <![CDATA[ <?php /** - * Define MyClass - */ +* Define MyClass +*/ class MyClass { - public $public = 'Public'; - protected $protected = 'Protected'; - private $private = 'Private'; - - function printHello() - { - echo $this->public; - echo $this->protected; - echo $this->private; - } + public $public = 'Public'; + protected $protected = 'Protected'; + private $private = 'Private'; + + function printHello() + { + echo $this->public; + echo $this->protected; + echo $this->private; + } } $obj = new MyClass(); @@ -45,26 +45,26 @@ /** - * Define MyClass2 - */ +* Define MyClass2 +*/ class MyClass2 extends MyClass { - // We can redeclare the public and protected method, but not private - protected $protected = 'Protected2'; + // 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; - } + function printHello() + { + echo $this->public; + echo $this->protected; + echo $this->private; + } } $obj2 = new MyClass2(); -echo $obj->public; // Works +echo $obj2->public; // Works echo $obj2->private; // Undefined echo $obj2->protected; // Fatal Error -$obj2->printHello(); // Shows Public, Protected2, not Private +$obj2->printHello(); // Shows Public, Protected2, Undefined ?> ]]>

« previous php.doc.cvs (#229) next »