3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $re = "/^[a-zA-Z ,.\p{Han}]+$/u"; $tests = array( 'Mr Smith', 'Mr. Smith', 'Mr. 123 Smith', '姓名', 'tom!!!', 'Mary@', 'May#', 'john$', ); foreach ($tests as $test) { if (preg_match($re, $test) !== 1) { echo $test . ' failed' . PHP_EOL; } }
based on SYTNe
Output for 4.4.3 - 4.4.9, 5.1.3 - 5.6.21, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Mr. 123 Smith failed tom!!! failed Mary@ failed May# failed john$ 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/j9Ru4 on line 17 Mr Smith failed Warning: preg_match(): Compilation failed: unknown property name after \P or \p at offset 17 in /in/j9Ru4 on line 17 Mr. Smith failed Warning: preg_match(): Compilation failed: unknown property name after \P or \p at offset 17 in /in/j9Ru4 on line 17 Mr. 123 Smith failed Warning: preg_match(): Compilation failed: unknown property name after \P or \p at offset 17 in /in/j9Ru4 on line 17 姓名 failed Warning: preg_match(): Compilation failed: unknown property name after \P or \p at offset 17 in /in/j9Ru4 on line 17 tom!!! failed Warning: preg_match(): Compilation failed: unknown property name after \P or \p at offset 17 in /in/j9Ru4 on line 17 Mary@ failed Warning: preg_match(): Compilation failed: unknown property name after \P or \p at offset 17 in /in/j9Ru4 on line 17 May# failed Warning: preg_match(): Compilation failed: unknown property name after \P or \p at offset 17 in /in/j9Ru4 on line 17 john$ failed
Output for 4.3.11, 5.0.2 - 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/j9Ru4 on line 17 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/j9Ru4 on line 17 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/j9Ru4 on line 17 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/j9Ru4 on line 17 姓名 failed Warning: preg_match(): Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/j9Ru4 on line 17 tom!!! failed Warning: preg_match(): Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/j9Ru4 on line 17 Mary@ failed Warning: preg_match(): Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/j9Ru4 on line 17 May# failed Warning: preg_match(): Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/j9Ru4 on line 17 john$ failed
Output for 5.0.0 - 5.0.1
Warning: preg_match(): Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/j9Ru4 on line 17 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/j9Ru4 on line 18 Mr Smith failedPHP_EOL Warning: preg_match(): Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/j9Ru4 on line 17 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/j9Ru4 on line 18 Mr. Smith failedPHP_EOL Warning: preg_match(): Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/j9Ru4 on line 17 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/j9Ru4 on line 18 Mr. 123 Smith failedPHP_EOL Warning: preg_match(): Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/j9Ru4 on line 17 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/j9Ru4 on line 18 姓名 failedPHP_EOL Warning: preg_match(): Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/j9Ru4 on line 17 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/j9Ru4 on line 18 tom!!! failedPHP_EOL Warning: preg_match(): Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/j9Ru4 on line 17 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/j9Ru4 on line 18 Mary@ failedPHP_EOL Warning: preg_match(): Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/j9Ru4 on line 17 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/j9Ru4 on line 18 May# failedPHP_EOL Warning: preg_match(): Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/j9Ru4 on line 17 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/j9Ru4 on line 18 john$ failedPHP_EOL
Output for 4.3.10
Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/j9Ru4 on line 17 Mr Smith failed Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/j9Ru4 on line 17 Mr. Smith failed Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/j9Ru4 on line 17 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/j9Ru4 on line 17 姓名 failed Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/j9Ru4 on line 17 tom!!! failed Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/j9Ru4 on line 17 Mary@ failed Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/j9Ru4 on line 17 May# failed Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/j9Ru4 on line 17 john$ failed
Output for 4.3.0 - 4.3.9
Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/j9Ru4 on line 17 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/j9Ru4 on line 18 Mr Smith failedPHP_EOL Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/j9Ru4 on line 17 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/j9Ru4 on line 18 Mr. Smith failedPHP_EOL Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/j9Ru4 on line 17 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/j9Ru4 on line 18 Mr. 123 Smith failedPHP_EOL Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/j9Ru4 on line 17 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/j9Ru4 on line 18 姓名 failedPHP_EOL Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/j9Ru4 on line 17 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/j9Ru4 on line 18 tom!!! failedPHP_EOL Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/j9Ru4 on line 17 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/j9Ru4 on line 18 Mary@ failedPHP_EOL Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/j9Ru4 on line 17 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/j9Ru4 on line 18 May# failedPHP_EOL Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/j9Ru4 on line 17 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/j9Ru4 on line 18 john$ failedPHP_EOL