note 116384 added to function.rand

From: Date: Thu, 25 Dec 2014 14:56:25 +0000
Subject: note 116384 added to function.rand
Groups: php.notes 
Request: Send a blank email to php-notes+get-201248@lists.php.net to get a copy of this message
If you need to call rand() over 32768 times, use mt_rand() instead. Because rand() will return a repeated sequence every 32768 calls. i.e. $v[] = array(); for( $i=0; $i<100000; $i++ ){ $v[] = rand(); } you will get an array that $v[n] equals to $v[n+32768] ---- Server IP: 72.52.91.14 Probable Submitter: 114.35.124.146 ---- Manual Page -- http://php.net/manual/en/function.rand.php Edit -- https://master.php.net/note/edit/116384 Del: integrated -- https://master.php.net/note/delete/116384/integrated Del: useless -- https://master.php.net/note/delete/116384/useless Del: bad code -- https://master.php.net/note/delete/116384/bad+code Del: spam -- https://master.php.net/note/delete/116384/spam Del: non-english -- https://master.php.net/note/delete/116384/non-english Del: in docs -- https://master.php.net/note/delete/116384/in+docs Del: other reasons-- https://master.php.net/note/delete/116384 Reject -- https://master.php.net/note/reject/116384 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#201248) next »