3v4l.org

run code in 500+ PHP versions simultaneously
<?php $fruits = [ 'ORANGE' => [ 'Size' => '0.20', 'Cost' => '0.49', 'Lbs.' => '0.60', ], 'LEMON' => [ 'Size' => '0.15', 'Cost' => '0.29', 'Lbs.' => '0.20', ] ]; $keys = array_keys($fruits); if(!empty($keys)) $innerKeys = array_keys($fruits[$keys[0]]); echo '<table id="fruits" style="width:400px;border:1px solid black;">'; echo '<thead><tr>'; echo '<td>----</td>'; foreach($keys as $key) echo '<td>'.$key.'</td>'; echo '</tr></thead>'; echo '<tbody>'; foreach($innerKeys as $inKey){ echo '<tr>'; echo '<td>'.$inKey.'</td>'; foreach($fruits as $fKey => $val){ echo '<td>'.$val[$inKey].'</td>'; } echo '</tr>'; } echo '</tbody>'; echo '</table>';
Output for git.master, git.master_jit, rfc.property-hooks
<table id="fruits" style="width:400px;border:1px solid black;"><thead><tr><td>----</td><td>ORANGE</td><td>LEMON</td></tr></thead><tbody><tr><td>Size</td><td>0.20</td><td>0.15</td></tr><tr><td>Cost</td><td>0.49</td><td>0.29</td></tr><tr><td>Lbs.</td><td>0.60</td><td>0.20</td></tr></tbody></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:
39.75 ms | 1606 KiB | 4 Q