3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = "0&39avfy;&39avfy;task&39avfy;rose&39avfy;duration&39avfy;1.25&39avfy;user&39avfy;15&39avfy;1&39avfy;&39avfy;task&39avfy;daisy&39avfy;duration&39avfy;0.75&39avfy;user&39avfy;25&39avfy;2&39avfy;&39avfy;task&39avfy;orchid&39avfy;duration&39avfy;1.15&39avfy;user&39avfy;7"; $result = []; $regex = <<<REGEX / (\d+)&39avfy; |\G(?!^)&39avfy;([^&]+)&39avfy;([^&]+) /x REGEX; preg_match_all($regex, $input, $m, PREG_SET_ORDER); foreach ($m as $set) { if (strlen($set[1])) { $index = $set[1]; } else { $result[$index][$set[2]] = $set[3]; } } var_export($result);
Output for git.master, git.master_jit, rfc.property-hooks
array ( 0 => array ( 'task' => 'rose', 'duration' => '1.25', 'user' => '15', ), 1 => array ( 'task' => 'daisy', 'duration' => '0.75', 'user' => '25', ), 2 => array ( 'task' => 'orchid', 'duration' => '1.15', 'user' => '7', ), )

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:
40.66 ms | 1014 KiB | 4 Q