3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tag = '[person name="Jackson" family="Smith"]'; var_export(preg_match_all('~(?:\G|\[\w+) (\w+)="(\w+)"~', $tag, $out) ? array_combine($out[1], $out[2]) : []);

preferences:
26.11 ms | 406 KiB | 5 Q