7.7. Calling Methods on an Object Returned by Another Method7.7.2. SolutionAssign the object to a temporary variable, and then call the method of that temporary variable: $orange = $fruit->get('citrus'); $orange->peel( ); 7.7.3. DiscussionThis is necessary because a parse error results from: $fruit->get('citrus')->peel( ); Zend Engine 2 supports direct dereferencing of objects returned from a method so this workaround is no longer necessary. Copyright © 2003 O'Reilly & Associates. All rights reserved. |
|