From 15a63ed54b3004144f690295dddc3dd05584778f Mon Sep 17 00:00:00 2001 From: Gabor Hojtsy Date: Mon, 20 Aug 2001 16:25:36 +0000 Subject: [PATCH] More typos fixed . object properties should start lowercased . some misspelled words, and bad examples corrected git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@55568 c90b9560-bf6c-de11-be94-00142212c4b1 --- language/oop.xml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/language/oop.xml b/language/oop.xml index 31fec773b9..1ea2b7ef97 100644 --- a/language/oop.xml +++ b/language/oop.xml @@ -1,5 +1,5 @@ - + Classes and Objects @@ -710,12 +710,12 @@ class Foo function echoName() { - echo "<br>",$this->Name; + echo "<br>",$this->name; } function setName($name) { - $this->Name = $name; + $this->name = $name; } } @@ -741,7 +741,7 @@ set in constructor set in constructor set in constructor */ -$bar2 =& new foo('set in constructor'); +$bar2 =& new Foo('set in constructor'); $bar2->echoName(); $globalref[1]->echoName(); @@ -761,7 +761,7 @@ set in constructor */ return a reference by default, instead it returns a copy. - There is no performance loss (since php 4 and up use reference + There is no performance loss (since PHP 4 and up use reference counting) returning copies instead of references. On the contrary it is most often better to simply work with copies instead of references, because creating references takes some @@ -776,7 +776,7 @@ set in constructor */ // now we will change the name. what do you expect? -// you could expect that both $bar and $globalref[0] change their names... +// you could expect that both $bar1 and $globalref[0] change their names... $bar1->setName('set from outside'); // as mentioned before this is not the case. @@ -784,14 +784,14 @@ $bar1->echoName(); $globalref[0]->echoName(); /* output: -set on object creation -set from outside */ +set from outside +set in constructor */ // let us see what is different with $bar2 and $globalref[1] $bar2->setName('set from outside'); -// luckily they are not only equyl, they are thesame variable -// thus $bar2->Name and $globalref[1]->Name are the same too +// luckily they are not only equal, they are the same variable +// thus $bar2->name and $globalref[1]->name are the same too $bar2->echoName(); $globalref[1]->echoName();