3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $etag = '"123-456\"789"'; $regex = '~(?:^|[\h,]+)(?:W/)?(")?(?(1)((?:[^"\\\\]|\\\\.)*(*MARK:Q))(?:"|\\\\|$)|([^,]*(*MARK:T)))~'; \preg_match_all($regex, $etag, $matches, \PREG_SET_ORDER); print_r($matches); var_dump(strpos('123\'123', '\\'));
based on BjOIS
Output for 5.6.30, 7.0.30 - 7.3.0rc3
Array ( [0] => Array ( [0] => "123-456\"789" [1] => " [2] => 123-456\"789 [MARK] => Q ) ) bool(false)
Output for hhvm-3.18.5 - 3.22.0
Array ( [0] => Array ( [0] => "123-456\"789" [1] => " [2] => 123-456\"789 ) ) bool(false)