3v4l.org

run code in 300+ PHP versions simultaneously
<?php $is_arabic = preg_match('/\p{Arabic}/u', " sadfdasf أنطونيو أسيفيدو"); echo "is_arabic: ".var_export($is_arabic, true); echo PHP_EOL; $is_not_arabic = preg_match('/\p{Arabic}/u', "sadfdasf"); echo "is_not_arabic: ".var_export($is_not_arabic, true); echo PHP_EOL; $is_numeric_arabic = preg_match('/^\p{N}+$/u', "١٢٣٤٥" /*Arabic numerals for "12345"*/); echo "is_numeric_arabic: ".var_export($is_numeric_arabic, true); echo PHP_EOL; $is_not_numeric_arabic = preg_match('/^\p{N}+$/u', "أنطونيو أسيفيدو"); echo "is_not_numeric_arabic: ".var_export($is_not_numeric_arabic, true);
Output for 8.1.0 - 8.1.30, 8.2.0 - 8.2.25, 8.3.0 - 8.3.13
is_arabic: 1 is_not_arabic: 0 is_numeric_arabic: 1 is_not_numeric_arabic: 0

preferences:
47.63 ms | 406 KiB | 5 Q