3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array=array( 1=>array('First','word'), 5=>array('Second','word'), 6=>array('Third','word'), 7=>array('-','non-word'), 8=>array('Fourth','word'), 10=>array('Fifth','word') ); foreach ($array as $key => $value) { echo $value[0]; if (!isset($array[$key+1])) { echo PHP_EOL; } else if ($array[$key+1][1] === 'word' && $array[$key][1] !== 'non-word') { echo ' '; } }
Output for git.master, git.master_jit, rfc.property-hooks
First Second Third-Fourth Fifth

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:
162.97 ms | 405 KiB | 5 Q