From c675988cae0a1e0656b1249629096132335624b7 Mon Sep 17 00:00:00 2001 From: Simon Samtleben Date: Tue, 1 May 2018 09:50:36 +0200 Subject: [PATCH] Fix php-version parameter type change in long2ip method --- src/Action/Cli/BenchmarkAction.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Action/Cli/BenchmarkAction.php b/src/Action/Cli/BenchmarkAction.php index ca534c9..eec7f15 100644 --- a/src/Action/Cli/BenchmarkAction.php +++ b/src/Action/Cli/BenchmarkAction.php @@ -37,7 +37,12 @@ private function runBenchmark() { $startTime = microtime(true); for ($i = 0; $i < $this->numLookups; $i++) { - $ip = long2ip(rand(0, pow(2, 32) -1)); + if (version_compare(PHP_VERSION, '7.1.0') >= 0) { + $rv = rand(0, pow(2, 32) -1); + } else { + $rv = (string) rand(0, pow(2, 32) -1); + } + $ip = long2ip($rv); try { $this->domain->getRecord($ip); } catch (\Exception $e) {