mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Grammar (bug #37215)
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@212066 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
0d733ce0f2
commit
cb6c61eeb8
1 changed files with 5 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.65 $ -->
|
||||
<!-- $Revision: 1.66 $ -->
|
||||
<chapter id="language.oop">
|
||||
<title>Classes and Objects (PHP 4)</title>
|
||||
|
||||
|
@ -231,10 +231,11 @@ $cart->$myvar = array("10" => 1);
|
|||
<para>
|
||||
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
|
||||
<varname>$cart</varname> or <varname>$another_cart</varname> later. Thus,
|
||||
written, it was unknown whether the object would be named
|
||||
<varname>$cart</varname>, <varname>$another_cart</varname>, or something
|
||||
else later. Thus,
|
||||
you cannot write <varname>$cart->items</varname> 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
|
||||
<varname>$this</varname> which can be read as 'my own' or 'current
|
||||
object'. Thus, '<varname>$this->items[$artnr]</varname> +=
|
||||
|
|
Loading…
Reference in a new issue