3v4l.org

run code in 300+ PHP versions simultaneously
<?php $temp="test 1-123.456\ntest 2-789.0\n"; $tok=strtok($temp,"\n"); while ($tok !== false) { $pos=strpos($tok,'-'); $pos2=strpos($tok,'.',$pos); $temp2=substr($tok,0,$pos); $pos++; $wordlist[$temp2]=array((int)substr($tok,$pos,$pos2-$pos),(int)substr($tok,$pos2+1)); $tok=strtok("\n"); } print_r($wordlist);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [test 1] => Array ( [0] => 123 [1] => 456 ) [test 2] => Array ( [0] => 789 [1] => 0 ) )

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