indirect_method_call_004.phpt 362 B

1234567891011121314151617181920212223242526
  1. --TEST--
  2. Indirect method call and cloning
  3. --FILE--
  4. <?php
  5. class bar {
  6. public $z;
  7. public function __construct() {
  8. $this->z = new stdclass;
  9. }
  10. public function getZ() {
  11. return $this->z;
  12. }
  13. }
  14. var_dump(clone (new bar)->z);
  15. var_dump(clone (new bar)->getZ());
  16. ?>
  17. --EXPECTF--
  18. object(stdClass)#%d (0) {
  19. }
  20. object(stdClass)#%d (0) {
  21. }