Skip to content
This repository has been archived by the owner on Dec 11, 2020. It is now read-only.

Commit

Permalink
some IP result on negative intergers
Browse files Browse the repository at this point in the history
  • Loading branch information
remicollet committed Jul 1, 2016
1 parent c760b81 commit b5c340b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Faker/Provider/Internet.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,10 @@ public static function localIpv4()
{
if (static::numberBetween(0, 1) === 0) {
// 10.x.x.x range
$ip = long2ip(static::numberBetween(167772160, 184549375));
$ip = long2ip(static::numberBetween(ip2long("10.0.0.0"), ip2long("10.255.255.255")));
} else {
// 192.168.x.x range
$ip = long2ip(static::numberBetween(3232235520, 3232301055));
$ip = long2ip(static::numberBetween(ip2long("192.168.0.0"), ip2long("192.168.255.255")));
}

return $ip;
Expand Down

0 comments on commit b5c340b

Please sign in to comment.