3v4l.org

run code in 300+ PHP versions simultaneously
<?php $shop = array( array("rose", 1.25 , 15), array("daisy", 0.75 , 25), array("orchid", 1.15 , 7) ); echo "<h1>Manual access to each element</h1>"; echo $shop[0][0]." costs ".$shop[0][1]." and you get ".$shop[0][2]."<br />"; echo $shop[1][0]." costs ".$shop[1][1]." and you get ".$shop[1][2]."<br />"; echo $shop[2][0]." costs ".$shop[2][1]." and you get ".$shop[2][2]."<br />"; echo "<h1>Using loops to display array elements</h1>"; echo "<ol>"; for ($row = 0; $row < 3; $row++) { echo "<li><b>The row number $row</b>"; echo "<ul>"; for ($col = 0; $col < 3; $col++) { echo "<li>".$shop[$row][$col]."</li>"; } echo "</ul>"; echo "</li>"; } echo "</ol>";
Output for git.master, git.master_jit, rfc.property-hooks
<h1>Manual access to each element</h1>rose costs 1.25 and you get 15<br />daisy costs 0.75 and you get 25<br />orchid costs 1.15 and you get 7<br /><h1>Using loops to display array elements</h1><ol><li><b>The row number 0</b><ul><li>rose</li><li>1.25</li><li>15</li></ul></li><li><b>The row number 1</b><ul><li>daisy</li><li>0.75</li><li>25</li></ul></li><li><b>The row number 2</b><ul><li>orchid</li><li>1.15</li><li>7</li></ul></li></ol>

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:
53.7 ms | 402 KiB | 8 Q