Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 11 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(1)
无论
$client->start()
方法返回什么,它都被键入为对象。您可以使用->
运算符访问对象的属性:这可能是一个数组,但正在输入到一个对象中。因此,您最终得到 stdClass。
另一种(可能是更好的)方法是输入返回值。这样,您就不必创建一个新数组以便稍后作为参数传递:
Whatever the
$client->start()
method is returning, it is typed as an object. You can access the properties of the object using the->
operator: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: