mirror of
https://github.com/php/php-src.git
synced 2024-12-19 15:00:15 +08:00
24 lines
284 B
PHP
24 lines
284 B
PHP
--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)
|