Will running the same script multiple times with a rand() call return different values?

Posted by aamir Fayyaz on Stack Overflow See other posts from Stack Overflow or by aamir Fayyaz
Published on 2010-06-16T05:18:15Z Indexed on 2010/06/16 5:42 UTC
Read the original article Hit count: 194

Filed under:

I have a script that calls the rand function:

<?php
echo rand(0, 9);
?>

If I run this script multiple times, will I get different numbers out, or will it always be the same? In other words, does PHP seed rand automatically?

© Stack Overflow or respective owner

Related posts about php