3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php preg_match_all('/\d/u', '123abc٠١٢٣٤٥٦٧٨٩', $matches); var_dump($matches);
based on oEvgJ
Output for 5.3.4 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
array(1) { [0]=> array(13) { [0]=> string(1) "1" [1]=> string(1) "2" [2]=> string(1) "3" [3]=> string(2) "٠" [4]=> string(2) "١" [5]=> string(2) "٢" [6]=> string(2) "٣" [7]=> string(2) "٤" [8]=> string(2) "٥" [9]=> string(2) "٦" [10]=> string(2) "٧" [11]=> string(2) "٨" [12]=> string(2) "٩" } }
Output for 4.3.0 - 5.3.3
array(1) { [0]=> array(3) { [0]=> string(1) "1" [1]=> string(1) "2" [2]=> string(1) "3" } }