3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = 'Mozilla/5.0 (Linux; Android 4.0; Galaxy Nexus Build/IMM76B) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.133 Mobile Safari/535.19'; $pattern = "/Android (\d).(\d)(?:.(\d))?/"; preg_match($pattern, $a, $matches); print_r($matches);
based on K3NJv
Output for 4.3.0 - 7.2.0
Array ( [0] => Android 4.0 [1] => 4 [2] => 0 )