3v4l.org

run code in 300+ PHP versions simultaneously
<?php $re = '/(\w+(?:-\w+)*)=(?|"((?:[^"]+|(?<=\\\\)")++)"|([^"\s]+))/'; $str = 'add name=100YER on-login=":do {:put \\"a\\";} on-error={};" rate-limit=256k/512k'; preg_match_all($re, $str, $matches); $result = array_combine($matches[1], $matches[2]); print_r($result);

preferences:
25.22 ms | 406 KiB | 5 Q