August 2003
Intermediate to advanced
1104 pages
19h 27m
English
The properties of an instance are variables, just like any other PHP variable. To refer to them, however, you must use the -> operator. You do not use a dollar sign in front of the property name. For an example, refer to line in Listing 6.1 that prints the name property of the user object.
Use of -> can be chained. If an object's property contains an object itself, you can use two -> operators to get to a property on the inner object. You may even place these expressions within double-quoted strings. See Listing 6.5 for an example of an object that contains an array of objects.
Accessing methods is similar to accessing properties. The -> operator is used to point to the instance's method. This is shown in ...
Read now
Unlock full access