3v4l.org

run code in 300+ PHP versions simultaneously
<?php $_rows = array(); $_sub_categories = array(); for($i = 1; $i <= 28; $i++) { if(in_array($i, array(1,2))) { $_rows['row1'][] = 'Category '.$i; } if(in_array($i, array(3,4,5))) { $_rows['row2'][] = 'Category '.$i; } if(in_array($i, array(6,7,8))) { $_rows['row3'][] = 'Category '.$i; } if(in_array($i, array(9,10,11))) { $_rows['row4'][] = 'Category '.$i; } if(in_array($i, array(12,13))) { $_rows['row5'][] = 'Category '.$i; } if(in_array($i, array(14,15,16))) { $_rows['row6'][] = 'Category '.$i; } if(in_array($i, array(17,18,19))) { $_rows['row7'][] = 'Category '.$i; } if(in_array($i, array(20,21,22))) { $_rows['row8'][] = 'Category '.$i; } if(in_array($i, array(23,24,25))) { $_rows['row9'][] = 'Category '.$i; } if(in_array($i, array(26,27,28))) { $_rows['row10'][] = 'Category '.$i; } } print_r($_rows[row1]); foreach($_rows as $_row):?> <ul> <?php $j = 0; ?> <?php foreach($_row as $_sub_category): $j++; ?> <li <?php if($j==1) { echo 'class="first"'; } ?>><?php echo $_sub_category; ?></li> <?php endforeach; ?> </ul> <?php endforeach; ?>
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Undefined constant "row1" in /in/gI2XW:50 Stack trace: #0 {main} thrown in /in/gI2XW on line 50
Process exited with code 255.

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:
49.18 ms | 401 KiB | 8 Q