3v4l.org

run code in 500+ PHP versions simultaneously
<?php $exploded = array( '1', 'Lorem ipsum', 'dolor sit', 'amet', '2', 'consectetur', 'adipiscing elit', 'adipiscing elit', '3', 'Integer nec', 'odio' ); $array = array(); $a = false; $count = 1; $arraycount = count($exploded); for ($i = 0; $i < $arraycount; $i++) { $countstring = $count + 1; $countstring = (string)$countstring; if ($exploded[$i] == $count) { $array[$count][] = $exploded[$i]; $a = true; } elseif ($a == true && $exploded[$i] == (string)$count) { $array[$count][] = $exploded[$i]; } elseif ($a == true && $exploded[$i + 1] != $countstring) { $array[$count][] = $exploded[$i]; } elseif ($a == true && $exploded[$i + 1] == $countstring) { $array[$count][] = $exploded[$i]; $count++; $a = false; } } echo '<pre>'; print_r($array);
Output for rfc.property-hooks
Warning: Undefined array key 11 in /in/EqnIN on line 35 <pre>Array ( [1] => Array ( [0] => 1 [1] => Lorem ipsum [2] => dolor sit [3] => amet ) [2] => Array ( [0] => 2 [1] => consectetur [2] => adipiscing elit [3] => adipiscing elit ) [3] => Array ( [0] => 3 [1] => Integer nec [2] => odio ) )

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:
55.73 ms | 1814 KiB | 4 Q