3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $matches = []; $query = '4300-test 350 9900'; preg_match_all( '/(([0-9]{1})+([\-]{0,1})+([a-z]{0,1})+(\S{0}))/', $query, $matches ); echo '<pre>'; print_r($matches,false);
based on 7Pb0K
Output for 5.4.0 - 7.2.0
<pre>Array ( [0] => Array ( [0] => 4300-test [1] => 350 [2] => 9900 ) [1] => Array ( [0] => 4300-test [1] => 350 [2] => 9900 ) [2] => Array ( [0] => 0 [1] => 0 [2] => 0 ) [3] => Array ( [0] => [1] => [2] => ) [4] => Array ( [0] => [1] => [2] => ) [5] => Array ( [0] => [1] => [2] => ) )
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/fnJZl on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[' in /in/fnJZl on line 2
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/fnJZl on line 2
Process exited with code 255.