3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $str = "Mozilla/4.5 [en] (X11; U; Linux 2.2.9 i586)"; preg_match_all('/;/', $str, $matches, PREG_OFFSET_CAPTURE); var_dump($matches); echo $matches[0][1];
Output for 5.5.0 - 5.6.21, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
array(1) { [0]=> array(2) { [0]=> array(2) { [0]=> string(1) ";" [1]=> int(21) } [1]=> array(2) { [0]=> string(1) ";" [1]=> int(24) } } } Notice: Array to string conversion in /in/GCPKl on line 9 Array
Output for 4.3.3 - 5.4.45
array(1) { [0]=> array(2) { [0]=> array(2) { [0]=> string(1) ";" [1]=> int(21) } [1]=> array(2) { [0]=> string(1) ";" [1]=> int(24) } } } Array
Output for 4.3.0 - 4.3.2
<br /> <b>Warning</b>: Wrong value for parameter 4 in call to preg_match_all() in <b>/in/GCPKl</b> on line <b>5</b><br /> NULL