3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $my_key = uniqid("\x00"); if (preg_match('/[a-zA-Z]/', $my_key)) { echo "key has alpha chars\n"; } $my_key = preg_replace('/[a-zA-Z]/', "4", $my_key); var_dump(is_numeric($my_key)); $var[$my_key] = TRUE; foreach($var as $key => $val) { if ($key === $my_key) { echo 'You got it right'; } else { echo 'You got it wrong'; } }
based on VJ4a5
Output for 4.3.0 - 7.1.0
key has alpha chars bool(true) You got it wrong