Bug #68959 [NEW]: limit rand() function

From: Date: Fri, 30 Jan 2015 09:38:03 +0000
Subject: Bug #68959 [NEW]: limit rand() function
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-190347@lists.php.net to get a copy of this message
From: peter dot mlich at volny dot cz Operating system: win PHP version: 5.5.21 Package: *General Issues Bug Type: Bug Bug description:limit rand() function Description: ------------ After about 32000 function rand() repeating number (or zero?) as pattern. Array can be easy compressed by gzip. If you understand about compression, this is critical bug. I test array with 10.000 numbers, gzip compress to 33%. Other script with no rand() with read from file compress about 100.5% (my compress script about 95%). I cant use random data generator, if repeating as pattern which can easy compress with php-gzip. php 5.3.5, wamp server 2.1 php 5.5.12, wamp server 2.5 Test script: --------------- $max = 32000; $max = 100000; $arr = array(); for ($i=0;$i<$max;$i++) { $arr[$i] = rand(0,255); } return $arr; -- Edit bug report at https://bugs.php.net/bug.php?id=68959&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=68959&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=68959&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=68959&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=68959&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=68959&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=68959&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=68959&r=needscript Try newer version: https://bugs.php.net/fix.php?id=68959&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=68959&r=support Expected behavior: https://bugs.php.net/fix.php?id=68959&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=68959&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=68959&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=68959&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=68959&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=68959&r=dst IIS Stability: https://bugs.php.net/fix.php?id=68959&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=68959&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=68959&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=68959&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=68959&r=mysqlcfg

« previous php.bugs (#190347) next »