3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $test = array (array('name'=> "harold", 'age'=> 24),array('name'=> "sonia", 'age'=> 25),array('name'=> "isaiah", 'age'=> 5),); $j = 1; $min_result = array(); for($i=0; $i<count($test); $i++){ if($test[$i]['age'] < $test[j][age]){ $min_result = $test[$i]; } else{ $min_result = $test[$j]; $j++; } } var_dump($min_result) ?>
Output for 7.2.0 - 7.2.6
Warning: Use of undefined constant j - assumed 'j' (this will throw an Error in a future version of PHP) in /in/VQsRg on line 8 Warning: Use of undefined constant age - assumed 'age' (this will throw an Error in a future version of PHP) in /in/VQsRg on line 8 Notice: Undefined index: j in /in/VQsRg on line 8 Warning: Use of undefined constant j - assumed 'j' (this will throw an Error in a future version of PHP) in /in/VQsRg on line 8 Warning: Use of undefined constant age - assumed 'age' (this will throw an Error in a future version of PHP) in /in/VQsRg on line 8 Notice: Undefined index: j in /in/VQsRg on line 8 Warning: Use of undefined constant j - assumed 'j' (this will throw an Error in a future version of PHP) in /in/VQsRg on line 8 Warning: Use of undefined constant age - assumed 'age' (this will throw an Error in a future version of PHP) in /in/VQsRg on line 8 Notice: Undefined index: j in /in/VQsRg on line 8 Notice: Undefined offset: 3 in /in/VQsRg on line 13 NULL
Output for 5.3.0 - 7.1.20
Notice: Use of undefined constant j - assumed 'j' in /in/VQsRg on line 8 Notice: Use of undefined constant age - assumed 'age' in /in/VQsRg on line 8 Notice: Undefined index: j in /in/VQsRg on line 8 Notice: Use of undefined constant j - assumed 'j' in /in/VQsRg on line 8 Notice: Use of undefined constant age - assumed 'age' in /in/VQsRg on line 8 Notice: Undefined index: j in /in/VQsRg on line 8 Notice: Use of undefined constant j - assumed 'j' in /in/VQsRg on line 8 Notice: Use of undefined constant age - assumed 'age' in /in/VQsRg on line 8 Notice: Undefined index: j in /in/VQsRg on line 8 Notice: Undefined offset: 3 in /in/VQsRg on line 13 NULL
Output for 4.3.0 - 5.2.17
Notice: Use of undefined constant j - assumed 'j' in /in/VQsRg on line 8 Notice: Use of undefined constant age - assumed 'age' in /in/VQsRg on line 8 Notice: Undefined index: j in /in/VQsRg on line 8 Notice: Use of undefined constant j - assumed 'j' in /in/VQsRg on line 8 Notice: Use of undefined constant age - assumed 'age' in /in/VQsRg on line 8 Notice: Undefined index: j in /in/VQsRg on line 8 Notice: Use of undefined constant j - assumed 'j' in /in/VQsRg on line 8 Notice: Use of undefined constant age - assumed 'age' in /in/VQsRg on line 8 Notice: Undefined index: j in /in/VQsRg on line 8 Notice: Undefined offset: 3 in /in/VQsRg on line 13 NULL