PHP: Catchable fatal error: Object of class stdClass could not be converted to string [closed]

自闭症网瘾萝莉.ら 提交于 2019-11-29 15:49:46

Whatever the $client->start() method is returning, it is typed as an object. You can access the properties of the object using the -> operator:

$procID = $client->start(array("prefix"=>"Genesis"));

...

$exchange = $client->exchangeOptions(array("processId"=>$procID->processId));

This was probably an array, but is getting typed into an object. Thus, you end up with the stdClass.

Another (and possibly better) way to do this is to type the return. That way, you don't have to make a new array for later passing as argument:

$procID = (array) $client->start(array("prefix"=>"Genesis"));

...

$exchange = $client->exchangeOptions($procID);
$end = $client->stop($procID);
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!