3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = array( array('prior' => 1, 'name' => 'name'), array('prior' => 5, 'name' => 'name'), array('prior' => 2, 'name' => 'name'), array('prior' => 10, 'name' => 'name'), array('prior' => 12, 'name' => 'name'), array('prior' => 4, 'name' => 'name'), array('prior' => 7, 'name' => 'name'), array('prior' => 3, 'name' => 'name'), array('prior' => 8, 'name' => 'name'), array('prior' => 1, 'name' => 'name'), array('prior' => 12, 'name' => 'name'), ); for($i = 12; $i >= 1; $i--) { foreach($a as $task) { if ($task['prior'] != $i) { continue; } echo $task['prior'] . ': ' . $task['name'] . PHP_EOL; } }
Output for 4.3.10 - 4.4.9, 5.0.2 - 7.1.0
12: name 12: name 10: name 8: name 7: name 5: name 4: name 3: name 2: name 1: name 1: name
Output for 4.3.0 - 4.3.9, 5.0.0 - 5.0.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/rKfCC on line 23 12: namePHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/rKfCC on line 23 12: namePHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/rKfCC on line 23 10: namePHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/rKfCC on line 23 8: namePHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/rKfCC on line 23 7: namePHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/rKfCC on line 23 5: namePHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/rKfCC on line 23 4: namePHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/rKfCC on line 23 3: namePHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/rKfCC on line 23 2: namePHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/rKfCC on line 23 1: namePHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/rKfCC on line 23 1: namePHP_EOL