3v4l.org

run code in 300+ PHP versions simultaneously
<?php $s = "Set-Cookie: Name=Value; expires=Tue, 01 Jan 2018 00:00:00 GMT; domain=.site.com; path=/; httponly"; if (preg_match_all('~(?:\G(?!^);|Set-Cookie:)\s*\K([^=\n]+)(?:=([^;\n]+))?~', $s, $matches)) { print_r(array_combine($matches[1],$matches[2])); }

preferences:
48.68 ms | 406 KiB | 6 Q