3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = '-Parameter1=1234 -Parameter2=38518 -param3 "Test \"escaped\"" -param4 10 -param5 0 -param6 "TT" -param7 "Seven" -param8 "secret" "-SuperParam9=4857?--SuperParam10=123"'; $pattern = '~--?(?<key>[^= ]+)[ =] (?| "(?<value> [^\\\\"]*+ (?s:\\\\.[^\\\\"]*)*+ )" | ([^ ?"]*) )~x'; preg_match_all ($pattern, $str, $matches); $result = array_combine($matches['key'], $matches['value']); print_r($result);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [Parameter1] => 1234 [Parameter2] => 38518 [param3] => Test \"escaped\" [param4] => 10 [param5] => 0 [param6] => TT [param7] => Seven [param8] => secret [SuperParam9] => 4857 [SuperParam10] => 123 )

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.89 ms | 1633 KiB | 4 Q