3v4l.org

run code in 300+ PHP versions simultaneously
<?php $rand = range(1, 6); shuffle($rand); $foo["blue"] = 0; $foo["black"] = 0; $foo["red"] = 0; $foo["white"] = 0; $i=0; foreach ($foo as $key => $value) { $foo[$key] = $rand[$i]; $i++; } print_r($foo);

preferences:
33.11 ms | 406 KiB | 5 Q