3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $arr = array(); for ($i=1;$i<5;$i++) { $arr[] = array(i => i+5); } print_r($arr); // Standard asort asort($arr); print_r($tmp);
based on 3ncVu
Output for 7.1.0
Notice: Use of undefined constant i - assumed 'i' in /in/aav1a on line 7 Notice: Use of undefined constant i - assumed 'i' in /in/aav1a on line 7 Warning: A non-numeric value encountered in /in/aav1a on line 7 Notice: Use of undefined constant i - assumed 'i' in /in/aav1a on line 7 Notice: Use of undefined constant i - assumed 'i' in /in/aav1a on line 7 Warning: A non-numeric value encountered in /in/aav1a on line 7 Notice: Use of undefined constant i - assumed 'i' in /in/aav1a on line 7 Notice: Use of undefined constant i - assumed 'i' in /in/aav1a on line 7 Warning: A non-numeric value encountered in /in/aav1a on line 7 Notice: Use of undefined constant i - assumed 'i' in /in/aav1a on line 7 Notice: Use of undefined constant i - assumed 'i' in /in/aav1a on line 7 Warning: A non-numeric value encountered in /in/aav1a on line 7 Array ( [0] => Array ( [i] => 5 ) [1] => Array ( [i] => 5 ) [2] => Array ( [i] => 5 ) [3] => Array ( [i] => 5 ) ) Notice: Undefined variable: tmp in /in/aav1a on line 14
Output for 5.0.4 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.0.14
Notice: Use of undefined constant i - assumed 'i' in /in/aav1a on line 7 Notice: Use of undefined constant i - assumed 'i' in /in/aav1a on line 7 Notice: Use of undefined constant i - assumed 'i' in /in/aav1a on line 7 Notice: Use of undefined constant i - assumed 'i' in /in/aav1a on line 7 Notice: Use of undefined constant i - assumed 'i' in /in/aav1a on line 7 Notice: Use of undefined constant i - assumed 'i' in /in/aav1a on line 7 Notice: Use of undefined constant i - assumed 'i' in /in/aav1a on line 7 Notice: Use of undefined constant i - assumed 'i' in /in/aav1a on line 7 Array ( [0] => Array ( [i] => 5 ) [1] => Array ( [i] => 5 ) [2] => Array ( [i] => 5 ) [3] => Array ( [i] => 5 ) ) Notice: Undefined variable: tmp in /in/aav1a on line 14
Output for 4.3.0 - 5.0.3
Notice: Use of undefined constant i - assumed 'i' in /in/aav1a on line 7 Notice: Use of undefined constant i - assumed 'i' in /in/aav1a on line 7 Notice: Use of undefined constant i - assumed 'i' in /in/aav1a on line 7 Notice: Use of undefined constant i - assumed 'i' in /in/aav1a on line 7 Notice: Use of undefined constant i - assumed 'i' in /in/aav1a on line 7 Notice: Use of undefined constant i - assumed 'i' in /in/aav1a on line 7 Notice: Use of undefined constant i - assumed 'i' in /in/aav1a on line 7 Notice: Use of undefined constant i - assumed 'i' in /in/aav1a on line 7 Array ( [0] => Array ( [i] => 5 ) [1] => Array ( [i] => 5 ) [2] => Array ( [i] => 5 ) [3] => Array ( [i] => 5 ) ) Notice: Undefined variable: tmp in /in/aav1a on line 14