3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Force an all-numeric uniqid (happens at certain system clock values) $my_key = uniqid("\x00"); $my_key = preg_replace('/[a-zA-Z]/', "4", $my_key); $my_key .= "a"; $var[$my_key] = TRUE; foreach($var as $key => $val) { if ($key === $my_key) { echo 'You got it right'; } else { echo 'You got it wrong'; } }

preferences:
37.85 ms | 402 KiB | 5 Q