3v4l.org

run code in 300+ PHP versions simultaneously
<?php $grades = array(92, 84, 84, 84, 83, 65, 41, 38, 37, 37); $occurrences = array_count_values($grades); $grades = array_unique($grades); foreach($grades as $grade) { if($grade == end($grades))$i += $occurrences[$grade]-1; echo str_repeat($grade .' - '.($i+1).'<br>',$occurrences[$grade]); $i += $occurrences[$grade]; }
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined variable $i in /in/M0Qo9 on line 7 92 - 1<br> Warning: Undefined variable $i in /in/M0Qo9 on line 8 84 - 2<br>84 - 2<br>84 - 2<br>83 - 5<br>65 - 6<br>41 - 7<br>38 - 8<br>37 - 10<br>37 - 10<br>

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:
48.57 ms | 401 KiB | 8 Q