mirror of
https://github.com/php/php-src.git
synced 2024-12-20 23:39:46 +08:00
27 lines
335 B
Plaintext
27 lines
335 B
Plaintext
|
--TEST--
|
||
|
Indirect method call and cloning
|
||
|
--FILE--
|
||
|
<?php
|
||
|
|
||
|
|
||
|
class bar {
|
||
|
public $z;
|
||
|
|
||
|
public function __construct() {
|
||
|
$this->z = new stdclass;
|
||
|
}
|
||
|
public function getZ() {
|
||
|
return $this->z;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
var_dump(clone (new bar)->z);
|
||
|
var_dump(clone (new bar)->getZ());
|
||
|
|
||
|
?>
|
||
|
--EXPECTF--
|
||
|
object(stdClass)#%d (0) {
|
||
|
}
|
||
|
object(stdClass)#%d (0) {
|
||
|
}
|