3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function isMangled($key) { $arr = array(); $arr[$key] = null; return (string) $key !== (string) key($arr); } var_dump( isMangled(1), isMangled(1.5), isMangled('1'), isMangled('1.5'), isMangled(null), isMangled("test"), isMangled("test\0") );
based on r2MLs
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
bool(false) bool(true) bool(false) bool(false) bool(false) bool(false) bool(false)