3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function getSeed($data) { $seed = ""; for ($i = 0; $i < strlen($data); $i++) { $val = ord($data[$i]); $seed = $seed."$val"; } return $seed; } $seed = getSeed("test"); srand(intval($seed)); /* Seed random number generator */ $uid = rand(); echo $uid; ?>
based on HGtPh
Output for 7.1.0
1331216207
Output for 4.3.0 - 7.0.14
1389333584