
php中的错误和异常是两个不同的概念。
$str = 'good, luck';
$content = base64_decode($str);
var_dump($content);
$content = $content ?: $str;
echo \json_encode($content), PHP_EOL;
echo json_last_error_msg(),PHP_EOL;
===================================================================
[FATAL ERROR]: all coroutines (count: 1) are asleep - deadlock!
===================================================================
[Coroutine-1]
--------------------------------------------------------------------
#0 Swoole\Coroutine\Http\Client->recv() called at [/opt/webserver/vendor/swlib/saber/src/WebSocket.php:102]
#1 Swlib\Saber\WebSocket->recv() called at [/opt/webserver/script/src/Task/BinanceContract.php:133]
#2 Task\Test->init() called at [/opt/webserver/script/src/Task/BootScript.php:56]
public String toBase58() {
byte[] data = new byte[25];
data[0] = COIN_VERSION;
System.arraycopy(toArray(), 0, data, 1, 20);
byte[] checksum = Digest.sha256(Digest.sha256(data, 0, 21));
System.arraycopy(checksum, 0, data, 21, 4);
return Base58.encode(data);
}