true, CURLOPT_CONNECTTIMEOUT => 3, CURLOPT_TIMEOUT => 5, ]); $json = curl_exec($ch); if ($json === false) { throw new RuntimeException('Signal K error: ' . curl_error($ch)); } $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); if ($httpCode !== 200) { throw new RuntimeException('Signal K HTTP-error: ' . $httpCode); } return json_decode($json, true, 512, JSON_THROW_ON_ERROR); }