3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $dis = [45 => 422.555, 67=> 596.555, 72 => 322.55]; asort($dis); $arr = reset($dis); echo key(arr);
based on rJZEr
Output for 7.2.0 - 7.3.0rc6
Warning: Use of undefined constant arr - assumed 'arr' (this will throw an Error in a future version of PHP) in /in/CT7AB on line 6 Warning: key() expects parameter 1 to be array, string given in /in/CT7AB on line 6
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.1.20
Notice: Use of undefined constant arr - assumed 'arr' in /in/CT7AB on line 6 Warning: key() expects parameter 1 to be array, string given in /in/CT7AB on line 6
Output for hhvm-3.15.4
Notice: Use of undefined constant arr - assumed 'arr' in /in/CT7AB on line 6 Warning: Invalid operand type was used: expecting an array in /in/CT7AB on line 6