3v4l.org

run code in 200+ 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.2.0
Warning: Use of undefined constant i - assumed 'i' (this will throw an Error in a future version of PHP) in /in/aav1a on line 7 Warning: Use of undefined constant i - assumed 'i' (this will throw an Error in a future version of PHP) in /in/aav1a on line 7 Warning: A non-numeric value encountered in /in/aav1a on line 7 Warning: Use of undefined constant i - assumed 'i' (this will throw an Error in a future version of PHP) in /in/aav1a on line 7 Warning: Use of undefined constant i - assumed 'i' (this will throw an Error in a future version of PHP) in /in/aav1a on line 7 Warning: A non-numeric value encountered in /in/aav1a on line 7 Warning: Use of undefined constant i - assumed 'i' (this will throw an Error in a future version of PHP) in /in/aav1a on line 7 Warning: Use of undefined constant i - assumed 'i' (this will throw an Error in a future version of PHP) in /in/aav1a on line 7 Warning: A non-numeric value encountered in /in/aav1a on line 7 Warning: Use of undefined constant i - assumed 'i' (this will throw an Error in a future version of PHP) in /in/aav1a on line 7 Warning: Use of undefined constant i - assumed 'i' (this will throw an Error in a future version of PHP) 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 7.1.0 - 7.1.10
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 - 7.0.20
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