3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $text = '9 - 1'; preg_match_all('/\d+/', $text, $out); var_dump($out[0]); var_dump(end($out[0])); $text = '5-3'; preg_match_all('/\d+/', $text, $out); var_dump($out[0]); var_dump(end($out[0]));
based on 3Feek
Output for 4.3.0 - 7.2.0
array(2) { [0]=> string(1) "9" [1]=> string(1) "1" } string(1) "1" array(2) { [0]=> string(1) "5" [1]=> string(1) "3" } string(1) "3"