3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arrayTable = [ [1, 2, 3, 4, 5], [6, 7, 8, 9, 10], ]; $i = 0; $transpose = []; while ($columns = array_column($arrayTable, $i++)) { $transpose[] = $columns; } $table = '<table border="1">'; $rows = count($transpose); for ($i = 0; $i < $rows; $i++){ $cols = count($transpose[$i]); $table .= '<tr>'; for ($j = 0; $j < $cols; $j++) { $table .= '<td>' . $transpose[$i][$j] . '</td>'; } $table .= '</tr>'; } $table .= '</table>'; echo $table;
Output for git.master, git.master_jit, rfc.property-hooks
<table border="1"><tr><td>1</td><td>6</td></tr><tr><td>2</td><td>7</td></tr><tr><td>3</td><td>8</td></tr><tr><td>4</td><td>9</td></tr><tr><td>5</td><td>10</td></tr></table>

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:
30.43 ms | 406 KiB | 5 Q