var_export($err,true)输出如下
怎么通过$err调用里面的error???Qiniu\Http\Error::__set_state(array(
'url' => 'http://rs.qbox.me/move/cXVhbjpGc0MwVDNua3dTV2d1bGI0eUhvSnJNaXp4N1pf/cXVhbjphZG1pbi8xL2dvb2RzLzMvZGVzYy8xNDgyMTM2OTQxL0ZzQzBUM25rd1NXZ3VsYjR5SG9Kck1peng3Wl8=',
'response' =>
Qiniu\Http\Response::__set_state(array(
'statusCode' => 614,
'headers' =>
array (
'Server' => 'nginx/1.4.4',
'Date' => 'Mon, 19 Dec 2016 08',
'Content-Type' => 'application/json',
'Content-Length' => '23',
'Connection' => 'keep-alive',
'Cache-Control' => 'no-store',
'X-Log' => 'rs27_7.sel;rdb.g/no such key;DBD/404;v4.exist/Document not found;rs27_11.ins/E11000 duplicate key error colle;rs27_11.find;rs27_11.sel;qtbl.mv',
'X-Reqid' => 'ug0AANezQVEinJEU',
),
'body' => '{"error":"file exists"}',
'error' => 'file exists',
'jsonData' =>
array (
'error' => 'file exists',
),
'duration' => 0.073999999999999996,
)),
))
其实模拟一下就知道了<?php
class Error{
public static function __set_state($data){
return $data;
}
}class Response{
public static function __set_state($data){
return $data;
}
}
$err = \Error::__set_state(array(
'url' => 'http://rs.qbox.me/move/cXVhbjpGc0MwVDNua3dTV2d1bGI0eUhvSnJNaXp4N1pf/cXVhbjphZG1pbi8xL2dvb2RzLzMvZGVzYy8xNDgyMTM2OTQxL0ZzQzBUM25rd1NXZ3VsYjR5SG9Kck1peng3Wl8=',
'response' =>
\Response::__set_state(array(
'statusCode' => 614,
'headers' =>
array (
'Server' => 'nginx/1.4.4',
'Date' => 'Mon, 19 Dec 2016 08',
'Content-Type' => 'application/json',
'Content-Length' => '23',
'Connection' => 'keep-alive',
'Cache-Control' => 'no-store',
'X-Log' => 'rs27_7.sel;rdb.g/no such key;DBD/404;v4.exist/Document not found;rs27_11.ins/E11000 duplicate key error colle;rs27_11.find;rs27_11.sel;qtbl.mv',
'X-Reqid' => 'ug0AANezQVEinJEU',
),
'body' => '{"error":"file exists"}',
'error' => 'file exists',
'jsonData' =>
array (
'error' => 'file exists',
),
'duration' => 0.073999999999999996,
)),
));echo $err['response']['error'];