3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = [ 'application/ld+json', 'application/json', 'text/html', ]; if ($accept = preg_grep('~(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$~', $a)) { var_dump(implode(',', $accept)); }

preferences:
169.46 ms | 406 KiB | 5 Q