From b5c340b30b62daefcd1640968c77ab4b43a39194 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 1 Jul 2016 10:39:12 +0200 Subject: [PATCH] some IP result on negative intergers --- src/Faker/Provider/Internet.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Faker/Provider/Internet.php b/src/Faker/Provider/Internet.php index 9ab5613abe..dfd9e56000 100644 --- a/src/Faker/Provider/Internet.php +++ b/src/Faker/Provider/Internet.php @@ -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;