3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $tests = [ "hello", "hello:me", "hello::me", "::me", "hello::hello::me", ]; foreach ($tests as $test) { preg_match_all('/([^:]+)::(.+)/', $test, $matches); print_r($matches); echo PHP_EOL; }
based on RYeZD
Output for 5.4.0 - 7.2.0
Array ( [0] => Array ( ) [1] => Array ( ) [2] => Array ( ) ) Array ( [0] => Array ( ) [1] => Array ( ) [2] => Array ( ) ) Array ( [0] => Array ( [0] => hello::me ) [1] => Array ( [0] => hello ) [2] => Array ( [0] => me ) ) Array ( [0] => Array ( ) [1] => Array ( ) [2] => Array ( ) ) Array ( [0] => Array ( [0] => hello::hello::me ) [1] => Array ( [0] => hello ) [2] => Array ( [0] => hello::me ) )
Output for 5.3.19 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/qWi4K on line 3
Process exited with code 255.