3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ ['FA',12.9], ['FA',12.9], ['FB',12.2], ['FC',12.3], ['FA',12.9], ['FB',12.9], ['FA',12.4], ]; $grouped = []; foreach ($array as $row) { $compositeKey = implode($row); if (!isset($grouped[$compositeKey])) { $grouped[$compositeKey] = array_merge($row, [1]); } else { ++$grouped[$compositeKey][2]; } } foreach ($grouped as $row) { vprintf("%s %0.1fx%d\n", $row); }
Output for git.master, git.master_jit, rfc.property-hooks
FA 12.9x3 FB 12.2x1 FC 12.3x1 FB 12.9x1 FA 12.4x1

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:
27.08 ms | 405 KiB | 5 Q