3v4l.org

run code in 500+ PHP versions simultaneously
<?php mt_srand(42); $first = [mt_rand(), rand()]; mt_srand(42); echo 'mt_rand/rand repeat after mt_srand(): ', var_export($first === [mt_rand(), rand()], true), "\n"; mt_srand(42); $first = @lcg_value(); mt_srand(42); echo 'lcg_value repeats after mt_srand(): ', var_export($first === @lcg_value(), true), "\n"; srand(42); $first = @lcg_value(); srand(42); echo 'lcg_value repeats after srand(): ', var_export($first === @lcg_value(), true), "\n";
Output for master
mt_rand/rand repeat after mt_srand(): true lcg_value repeats after mt_srand(): false lcg_value repeats after srand(): false

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
12.04 ms | 1164 KiB | 7 Q