3v4l.org

run code in 300+ PHP versions simultaneously
<?php $pet1 = 'dog'; $pet2 = 'cat'; $arrayvalue = array( array('brown', 'white'), array($pet1, $pet2) ); // echo both parts: for ($i=0; $i<2; $i++) echo $arrayvalue[0][$i] . ' ' . $arrayvalue[1][$i] . '<br>'; echo "\n"; //echo just the first part: echo $arrayvalue[0][0] . ' ' . $arrayvalue[1][0]; echo "\n"; //echo just the second part: echo $arrayvalue[0][1] . ' ' . $arrayvalue[1][1]; echo "\n"; //echo just "brown white": echo $arrayvalue[0][0] . ' ' . $arrayvalue[0][1]; echo "\n"; //echo just "dog cat": echo $arrayvalue[1][0] . ' ' . $arrayvalue[1][1]; //echo just "white brown": echo $arrayvalue[0][1] . ' ' . $arrayvalue[0][0]; echo "\n"; //echo just "cat dog": echo $arrayvalue[1][1] . ' ' . $arrayvalue[1][0]; echo "\n"; //echo both "brown white" and "dog cat": foreach ($arrayvalue as $a) echo $a[0] . ' ' . $a[1] . '<br>'; echo "\n"; //echo both "white brown" and "cat dog": foreach ($arrayvalue as $a) echo $a[1] . ' ' . $a[0] . '<br>';
Output for git.master, git.master_jit, rfc.property-hooks
brown dog<br>white cat<br> brown dog white cat brown white dog catwhite brown cat dog brown white<br>dog cat<br> white brown<br>cat dog<br>

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.44 ms | 401 KiB | 8 Q