diff --git a/src/RPC/MultiRPC.php b/src/RPC/MultiRPC.php index 2e70e99..b8d5dfe 100644 --- a/src/RPC/MultiRPC.php +++ b/src/RPC/MultiRPC.php @@ -78,7 +78,7 @@ public function __construct( // Check if the existing relays (if any) and the new relays are of the same type. if (\count(self::$freeRelays) > 0) { - $existingRelay = self::$freeRelays[0]; + $existingRelay = self::$freeRelays[\array_key_first(self::$freeRelays)]; } elseif (\count(self::$occupiedRelays) > 0) { $existingRelay = self::$occupiedRelays[\array_key_first(self::$occupiedRelays)]; } else {