3v4l.org

run code in 300+ PHP versions simultaneously
<?php function parse($args) { $jobArgs = []; $list = explode(',', $args); foreach ($list as $item) { $splitArg = explode('=', $item); $jobArgs[$splitArg[0]] = $splitArg[1]; } return $jobArgs; } function parse2($args) { $jobArgs = []; $list = str_replace(',', '&', $args); return parse_str($list); } var_dump(parse("one=test,two=another,three=win")); var_dump(parse2("one=test,two=another,three=win"));
Output for git.master, git.master_jit, rfc.property-hooks
array(3) { ["one"]=> string(4) "test" ["two"]=> string(7) "another" ["three"]=> string(3) "win" } Fatal error: Uncaught ArgumentCountError: parse_str() expects exactly 2 arguments, 1 given in /in/gbXjX:24 Stack trace: #0 /in/gbXjX(24): parse_str('one=test&two=an...') #1 /in/gbXjX(28): parse2('one=test,two=an...') #2 {main} thrown in /in/gbXjX on line 24
Process exited with code 255.

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