note 8832 deleted from rand by ronabop

From: Date: Mon, 02 Oct 2000 11:56:06 +0000
Subject: note 8832 deleted from rand by ronabop
Groups: php.notes 
Request: Send a blank email to php-notes+get-5952@lists.php.net to get a copy of this message
This function seems to have a problem with generating a random number if the min and max values are the same. I tried it with rand(0, 0) just to see, and I received an invalid range error. You'd think that it would just pick 0. This occurred when I was trying tp choose a random value from an array by picking a random number from 0 to sizeof($array) - 1. The array only had one element in it.

« previous php.notes (#5952) next »