3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $re = "/^[a-zA-Z ,.\p{Han}]+$/"; $tests = array( 'Mr Smith', 'Mr. Smith', 'Mr. 123 Smith', '姓名' ); foreach ($tests as $test) { if (preg_match($re, $test) !== 1) { echo $test . ' failed'; } }
based on GQlOV
Output for 5.2.10 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Mr. 123 Smith failed姓名 failed
Output for 4.4.3 - 4.4.9, 5.1.3 - 5.2.9
Mr. 123 Smith failed
Output for 4.4.0 - 4.4.2, 5.0.5 - 5.1.2
Warning: preg_match(): Compilation failed: unknown property name after \P or \p at offset 17 in /in/X6Leg on line 12 Mr Smith failed Warning: preg_match(): Compilation failed: unknown property name after \P or \p at offset 17 in /in/X6Leg on line 12 Mr. Smith failed Warning: preg_match(): Compilation failed: unknown property name after \P or \p at offset 17 in /in/X6Leg on line 12 Mr. 123 Smith failed Warning: preg_match(): Compilation failed: unknown property name after \P or \p at offset 17 in /in/X6Leg on line 12 姓名 failed
Output for 4.3.11, 5.0.0 - 5.0.4
Warning: preg_match(): Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/X6Leg on line 12 Mr Smith failed Warning: preg_match(): Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/X6Leg on line 12 Mr. Smith failed Warning: preg_match(): Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/X6Leg on line 12 Mr. 123 Smith failed Warning: preg_match(): Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/X6Leg on line 12 姓名 failed
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 12 in /in/X6Leg on line 12 Mr Smith failed Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/X6Leg on line 12 Mr. Smith failed Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/X6Leg on line 12 Mr. 123 Smith failed Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/X6Leg on line 12 姓名 failed