cnewbill Fri Feb 9 11:41:09 2001 EDT
Modified files:
/phpdoc/en/language oop.xml
Log:
Added the following lines:
Both in and outside of the object you do not need a $ when accessing an
object's properties.
Also a code snippet to reference the previous statement.
Index: phpdoc/en/language/oop.xml
diff -u phpdoc/en/language/oop.xml:1.5 phpdoc/en/language/oop.xml:1.6
--- phpdoc/en/language/oop.xml:1.5 Mon Oct 2 02:37:53 2000
+++ phpdoc/en/language/oop.xml Fri Feb 9 11:41:08 2001
@@ -99,8 +99,24 @@
<para>
Within functions of a class the variable $this means this
object. You have to use $this->something to access any variable or
- function named something within your current object.
+ function named something within your current object. Both in and
+ outside of the object you do not need a $ when accessing an object's
+ properties.
</para>
+
+ <informalexample>
+ <programlisting role="php">
+$ncart->owner = "chris"; // no $
+
+$ncart->$owner = "chris";
+// this is invalid because $ncart->$owner = $ncart->""
+
+$myvar = 'owner';
+$ncart->$myvar = "chris";
+// this is valid because $ncart->$myvar = $ncart->owner
+ </programlisting>
+ </informalexample>
+
<para>
Constructors are functions in a class that are automatically
called when you create a new instance of a class. A function