1
0
mirror of https://github.com/fzaninotto/Faker.git synced 2025-03-22 00:09:59 +01:00

Fix issue in ipv4 formatter on 32 platforms

Patch from @pokmot.

Closes #93
This commit is contained in:
Francois Zaninotto 2012-12-12 09:00:07 +01:00
parent d44f1340d9
commit a52a44508b

View File

@ -119,7 +119,7 @@ class Internet extends \Faker\Provider\Base
*/
public function ipv4()
{
return long2ip(mt_rand(-2147483648, 2147483647));
return long2ip(mt_rand(0, 1) == 0 ? mt_rand(-2147483648, 0) : mt_rand(1, 2147483647));
}
/**