From cb6c61eeb89feaa9de1f0e420865c4ffac4ef287 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Thu, 27 Apr 2006 07:29:20 +0000 Subject: [PATCH] Grammar (bug #37215) git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@212066 c90b9560-bf6c-de11-be94-00142212c4b1 --- language/oop.xml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/language/oop.xml b/language/oop.xml index 24de95b9a0..570a6b67ce 100644 --- a/language/oop.xml +++ b/language/oop.xml @@ -1,5 +1,5 @@ - + Classes and Objects (PHP 4) @@ -231,10 +231,11 @@ $cart->$myvar = array("10" => 1); Within a class definition, you do not know under which name the object will be accessible in your program: at the time the Cart class was - written, it was unknown that the object will be named - $cart or $another_cart later. Thus, + written, it was unknown whether the object would be named + $cart, $another_cart, or something + else later. Thus, you cannot write $cart->items within the Cart class - itself. Instead, in order to be able to access it's own functions and + itself. Instead, in order to be able to access its own functions and variables from within a class, one can use the pseudo-variable $this which can be read as 'my own' or 'current object'. Thus, '$this->items[$artnr] +=