1--TEST-- 2ZE2 dereferencing of objects from methods 3--FILE-- 4<?php 5 6class Name { 7 function __construct($_name) { 8 $this->name = $_name; 9 } 10 11 function display() { 12 echo $this->name . "\n"; 13 } 14} 15 16class Person { 17 private $name; 18 19 function __construct($_name, $_address) { 20 $this->name = new Name($_name); 21 } 22 23 function getName() { 24 return $this->name; 25 } 26} 27 28$person = new Person("John", "New York"); 29$person->getName()->display(); 30 31?> 32--EXPECT-- 33John 34