php什么版本呀?
(new Test($obj))->client
这种表达式5.4以前不支持
class Foo {
public function method(){
echo 'hi';
}
}
class Test {
public $client;
public function __construct($obj){
$this->client = $obj;
}
}
$obj = new Foo();
// 代码1
$client = (new Test($obj))->client;
$client->method();