diff --git a/src/Faker/Provider/DateTime.php b/src/Faker/Provider/DateTime.php index 7baa7bcbd5..2b0cf6d489 100644 --- a/src/Faker/Provider/DateTime.php +++ b/src/Faker/Provider/DateTime.php @@ -62,8 +62,9 @@ public static function dateTime($max = 'now', $timezone = null) */ public static function dateTimeAD($max = 'now', $timezone = null) { + $min = (PHP_INT_SIZE>4 ? -62135597361 : -PHP_INT_MAX); return static::setTimezone( - new \DateTime('@' . mt_rand(-62135597361, static::getMaxTimestamp($max))), + new \DateTime('@' . mt_rand($min, static::getMaxTimestamp($max))), (null === $timezone ? date_default_timezone_get() : $timezone) ); } 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;