Skip to content

Commit

Permalink
Fix php-version parameter type change in long2ip method
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Samtleben committed May 1, 2018
1 parent 9194d05 commit c675988
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Action/Cli/BenchmarkAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit c675988

Please sign in to comment.