3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $string = '中文'; preg_match_all('/^[\p{L}\p{M}\p{N}_-]+$/u', $string, $matches); var_dump($matches);
Output for 4.4.3 - 4.4.9, 5.1.3 - 7.2.0
array(1) { [0]=> array(1) { [0]=> string(6) "中文" } }
Output for 4.4.0 - 4.4.2, 5.0.5 - 5.1.2
array(1) { [0]=> array(0) { } }
Output for 4.3.11, 5.0.0 - 5.0.4
Warning: preg_match_all(): Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 3 in /in/iUvba on line 5 array(0) { }
Output for 4.3.0 - 4.3.10
Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 3 in /in/iUvba on line 5 array(0) { }