diff --git a/src/Unirest/Request.php b/src/Unirest/Request.php index b49780d..a890ee1 100755 --- a/src/Unirest/Request.php +++ b/src/Unirest/Request.php @@ -555,7 +555,7 @@ private static function encodeUrl($url) $query = '?' . http_build_query(self::getArrayFromQuerystring($query)); } - if ($port && $port[0] !== ':') { + if ($port && ((string)$port)[0] !== ':') { $port = ':' . $port; }