3v4l.org

run code in 300+ PHP versions simultaneously
<?php $sortedScores = [ ['student_id' => 2, 'total_score' => 443], ['student_id' => 4, 'total_score' => 410], ['student_id' => 1, 'total_score' => 371], ['student_id' => 3, 'total_score' => 170], ]; foreach($sortedScores as $idx => $row) $sortedScores[$idx]['rank'] = $idx+1; var_export($sortedScores);
Output for git.master, git.master_jit, rfc.property-hooks
array ( 0 => array ( 'student_id' => 2, 'total_score' => 443, 'rank' => 1, ), 1 => array ( 'student_id' => 4, 'total_score' => 410, 'rank' => 2, ), 2 => array ( 'student_id' => 1, 'total_score' => 371, 'rank' => 3, ), 3 => array ( 'student_id' => 3, 'total_score' => 170, 'rank' => 4, ), )

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
28.34 ms | 406 KiB | 5 Q