3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $numbers = '0123456789'; $persian = '۱۲۳۴۵۶۷۸۹'; printf("Non-Unicode, ASCII numbers: %d\n", preg_match('/\d+/', $numbers)); printf("Non-Unicode, Persian numbers: %d\n", preg_match('/\d+/', $persian)); printf(" Unicode, ASCII numbers: %d\n", preg_match('/\d+/u', $numbers)); printf(" Unicode, Persian numbers: %d\n", preg_match('/\d+/u', $persian));
Output for 5.3.4 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Non-Unicode, ASCII numbers: 1 Non-Unicode, Persian numbers: 0 Unicode, ASCII numbers: 1 Unicode, Persian numbers: 1
Output for 4.3.0 - 5.3.3
Non-Unicode, ASCII numbers: 1 Non-Unicode, Persian numbers: 0 Unicode, ASCII numbers: 1 Unicode, Persian numbers: 0