3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $text = 'بيتر هو صبي.'; // arabic //$text = 'פיטר הוא ילד.'; // hebrew mb_regex_encoding('UTF-8'); if(mb_ereg('[\x{0600}-\x{06FF}]', $text)) // arabic range //if(mb_ereg('[\x{0590}-\x{05FF}]', $text)) // hebrew range { echo "Text has some arabic/hebrew characters."; } else { echo "Text doesnt have arabic/hebrew characters."; }
Output for 5.0.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Text has some arabic/hebrew characters.
Output for 4.3.4 - 4.4.9
Warning: mb_ereg(): mbregex compile err: invalid regular expression in /in/MS2Ue on line 8 Text doesnt have arabic/hebrew characters.
Output for 4.3.2 - 4.3.3
Fatal error: Call to undefined function: mb_regex_encoding() in /in/MS2Ue on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: mb_regex_encoding() in /in/MS2Ue on line 6