3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "1-350,9-390.99"; $partial = explode(',', $string); $final = array(); array_walk($partial, function($val) use(&$final){ list($key, $value) = explode('-', $val); $final[$key] = $value; }); print_r($final);
Output for git.master_jit, git.master, rfc.property-hooks
Array ( [1] => 350 [9] => 390.99 )

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