mirror of
https://github.com/php/php-src.git
synced 2024-09-24 19:37:26 +00:00
24 lines
284 B
Plaintext
24 lines
284 B
Plaintext
|
--TEST--
|
||
|
Testing indirect method call
|
||
|
--FILE--
|
||
|
<?php
|
||
|
|
||
|
class foo {
|
||
|
public $x = 1;
|
||
|
|
||
|
public function getX() {
|
||
|
return $this->x;
|
||
|
}
|
||
|
public function setX($val) {
|
||
|
$this->x = $val;
|
||
|
return $this;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
$X = (new foo)->setX(10)->getX();
|
||
|
var_dump($X); // int(10)
|
||
|
|
||
|
?>
|
||
|
--EXPECT--
|
||
|
int(10)
|