【发布时间】:2016-01-14 09:28:00
【问题描述】:
我有这个小sn-p:
$action = $_GET['action'];
// some other code
// works
$properties = $client->__soapCall($action, array(
array(
'Page' => $x
)
));
// try to get access to values by var $action
$obj = $properties->$action->item;
这给了我一个错误。我的意图是通过获取不同的操作,仅将脚本用于多次操作。
...但我不知道如何解决这个问题,也没有找到任何有用的帖子或文章。
var_dump($properties):
object(stdClass)#84 (4) {
["PropertyGroups"]=>
object(stdClass)#85 (1) {
["item"]=>
array(73) {
[0]=>
object(stdClass)#86 (7) {
["PropertyGroupID"]=>int(1)
}
}
}
}
【问题讨论】:
-
This gives me an error.我们应该猜对了吗? -
不,你不应该。对不起。如果
action = GetPropertyGroups,Undefined property: stdClass::$GetPropertyGroups -
var_dump($properties)
-
你使用的是什么 PHP 版本?
-
我目前使用的是 PHP 5.5.30,但可以升级到 7.0.1