3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $value = "1234 4569 "; $allowedInputSeparators = array('\r\n', '\n', '\t', ',', ';', '|', '\s'); $pattern = '/(.+?)' . implode('|', $allowedInputSeparators) . '/'; preg_match_all($pattern, $value, $matches, PREG_SET_ORDER); print_r($matches);
Output for 4.3.0 - 7.1.0
Array ( [0] => Array ( [0] => ) [1] => Array ( [0] => ) [2] => Array ( [0] => ) [3] => Array ( [0] => ) [4] => Array ( [0] => ) [5] => Array ( [0] => ) [6] => Array ( [0] => ) [7] => Array ( [0] => ) [8] => Array ( [0] => ) [9] => Array ( [0] => ) [10] => Array ( [0] => ) )