rand(), , .
-1, +1. 0 +/- .
$rand = (rand(0,1)*2-1)*rand(0, 100);
echo $rand;
LOT , , , . (50 000 ), 0,0004 , . , , , , , - .
:
$start = microtime();
$loopCount = 50000;
for($i=0;$i<$loopCount;$i++)
{
(0*2-1)*rand(0, 100);
}
$end = microtime();
echo "Timing: ", ((($end-$start)*1000.0)/((float)$loopCount)), " milliseconds.";