3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php mt_srand(42); echo mt_rand(1, 100), PHP_EOL; echo mt_rand(1, 100), PHP_EOL; echo mt_rand(1, 100), PHP_EOL; mt_srand(42); echo mt_rand(1, 100), PHP_EOL; echo mt_rand(1, 100), PHP_EOL; echo mt_rand(1, 100), PHP_EOL;
Output for 7.1.0
43 68 77 43 68 77
Output for 5.2.1 - 7.0.14
64 80 96 64 80 96
Output for 4.3.10 - 4.4.9, 5.0.2 - 5.2.0
65 25 40 65 25 40
Output for 4.3.0 - 4.3.9, 5.0.0 - 5.0.1
65 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/AMWtr on line 5 PHP_EOL25 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/AMWtr on line 6 PHP_EOL40 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/AMWtr on line 7 PHP_EOL65 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/AMWtr on line 11 PHP_EOL25 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/AMWtr on line 12 PHP_EOL40 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/AMWtr on line 13 PHP_EOL