3v4l.org

run code in 300+ PHP versions simultaneously
<?php $result = array ( array("Volvo", 22, 18), array("BMW", 15, 13), array("Saab", 5, 2), array("Land Rover", 17, 15) ); $columns = []; $rows = []; foreach ($result as $row) { foreach($row as $key => $column) { $key === 0 ? $columns[] = $row[$key] : $rows[$key][] = $row[$key]; } } echo implode("--", $columns) . PHP_EOL; foreach ($rows as $row) { echo implode("--", $row) . PHP_EOL; }
Output for git.master, git.master_jit, rfc.property-hooks
Volvo--BMW--Saab--Land Rover 22--15--5--17 18--13--2--15

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:
52.02 ms | 1424 KiB | 4 Q