我的 php 脚本有问题。 (我和我的朋友写这篇文章,对错误表示歉意) 这是向我展示的错误:
致命错误:未捕获 InvalidArgumentException:json_decode 错误: 语法错误在 /opt/html/wordpress_eagle/forums/vendor/guzzlehttp/guzzle/src/functions.php:306
堆栈跟踪:
#0 /opt/html/wordpress_eagle/forums/vendor/restcord/restcord/src/DiscordClient.php(229): GuzzleHttp\json_decode('')
#1 /opt/html/wordpress_eagle/forums/vendor/restcord/restcord/src/DiscordClient.php(184): RestCord\DiscordClient->convertResponseToResult('guild', Array, 对象(GuzzleHttp\Psr7\Response),对象(GuzzleHttp\Command\Command))
#2 /opt/html/wordpress_eagle/forums/vendor/guzzlehttp/command/src/ServiceClient.php(215): RestCord\DiscordClient->RestCord{closure}(对象(GuzzleHttp\Psr7\Response), 对象(GuzzleHttp\Psr7\Request),对象(GuzzleHttp\Command\Command))
#3 /opt/html/wordpress_eagle/forums/vendor/guzzlehttp/command/src/ServiceClient.php(177): GuzzleHttp\Command\ServiceClient->transformResponseToResult(Object(GuzzleHttp\Psr7\Response), 对象(GuzzleHttp\Psr7\Request),对象(GuzzleHttp\Command\Command))
#4 [内部函数]:/opt/html/wordpress_eagle/forums/vendor/guzzlehttp/command/src/Exception/CommandException.php 中的 GuzzleHtt 第 57 行
这是 json_decode 抛出错误 GuzzleHttp/src/functions.php 的地方: https://github.com/guzzle/guzzle/blob/4.1.0/src/functions.php#L305
*
* @param string $json JSON data to parse
* @param bool $assoc When true, returned objects will be converted
* into associative arrays.
* @param int $depth User specified recursion depth.
* @param int $options Bitmask of JSON decode options.
*
* @return mixed
* @throws \InvalidArgumentException if the JSON cannot be decoded.
* @link http://www.php.net/manual/en/function.json-decode.php
*/
Smart猫小萌