3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $str = 'CustomErrorLog "/errorlog wtf" hello bvc "jjrr" hello rrgg/x^$46/ "rggg£"'; preg_match_all('/(".*")|(\S+)/', $str, $matches); var_dump($matches);
based on tr0jC
Output for 4.3.0 - 7.1.0
array(3) { [0]=> array(2) { [0]=> string(14) "CustomErrorLog" [1]=> string(62) ""/errorlog wtf" hello bvc "jjrr" hello rrgg/x^$46/ "rggg£"" } [1]=> array(2) { [0]=> string(0) "" [1]=> string(62) ""/errorlog wtf" hello bvc "jjrr" hello rrgg/x^$46/ "rggg£"" } [2]=> array(2) { [0]=> string(14) "CustomErrorLog" [1]=> string(0) "" } }