3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "This is a string"; $words = explode(" ", $str); $spaces=array(); $others=array(); foreach($words as $word) { if($word==' ') { array_push($spaces,$word); } else { array_push($others,$word); } } var_export([ 'words' => $words, 'spaces' => $spaces, 'others' => $others ]);
Output for git.master, git.master_jit, rfc.property-hooks
array ( 'words' => array ( 0 => 'This', 1 => 'is', 2 => 'a', 3 => '', 4 => '', 5 => '', 6 => 'string', ), 'spaces' => array ( ), 'others' => array ( 0 => 'This', 1 => 'is', 2 => 'a', 3 => '', 4 => '', 5 => '', 6 => 'string', ), )

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:
150.83 ms | 406 KiB | 5 Q