Blog posts tagged with 'rand':



PHP srand problems with suhosin

Date: 13 Dec 2010
Tags: [ PHP ]  [ rand ]  [ suhosin

Today I stumbled across an odd problem which took me about an hour to figure out what was going on. It had to do with mt_srand(), where it looked like it didn’t work properly. I needed a repeatable sequence of random numbers (which is EXACTLY what the Mersenne Twister produces) so I used mt_srand() with a fixed number (for testing purposes) and tried to see if the same sequence of random values were generated by mt_rand()..  It didn’t…

Read more...