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$', 'ee%', 'e^', 'EE&', 'EE(', 'vivek' ); foreach ($tests as $test) { if (preg_match($re, $test) !== 1) { echo $test . ' failed' . PHP_EOL; } }
based on pZBJS
Output for 4.4.3 - 4.4.9, 5.1.3 - 7.1.0
Mr. 123 Smith failed tom!!! failed Mary@ failed May# failed john$ failed ee% failed e^ failed EE& failed EE( 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/8CCV0 on line 22 Mr Smith failed Warning: preg_match(): Compilation failed: unknown property name after \P or \p at offset 17 in /in/8CCV0 on line 22 Mr. Smith failed Warning: preg_match(): Compilation failed: unknown property name after \P or \p at offset 17 in /in/8CCV0 on line 22 Mr. 123 Smith failed Warning: preg_match(): Compilation failed: unknown property name after \P or \p at offset 17 in /in/8CCV0 on line 22 姓名 failed Warning: preg_match(): Compilation failed: unknown property name after \P or \p at offset 17 in /in/8CCV0 on line 22 tom!!! failed Warning: preg_match(): Compilation failed: unknown property name after \P or \p at offset 17 in /in/8CCV0 on line 22 Mary@ failed Warning: preg_match(): Compilation failed: unknown property name after \P or \p at offset 17 in /in/8CCV0 on line 22 May# failed Warning: preg_match(): Compilation failed: unknown property name after \P or \p at offset 17 in /in/8CCV0 on line 22 john$ failed Warning: preg_match(): Compilation failed: unknown property name after \P or \p at offset 17 in /in/8CCV0 on line 22 ee% failed Warning: preg_match(): Compilation failed: unknown property name after \P or \p at offset 17 in /in/8CCV0 on line 22 e^ failed Warning: preg_match(): Compilation failed: unknown property name after \P or \p at offset 17 in /in/8CCV0 on line 22 EE& failed Warning: preg_match(): Compilation failed: unknown property name after \P or \p at offset 17 in /in/8CCV0 on line 22 EE( failed Warning: preg_match(): Compilation failed: unknown property name after \P or \p at offset 17 in /in/8CCV0 on line 22 vivek 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/8CCV0 on line 22 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/8CCV0 on line 22 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/8CCV0 on line 22 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/8CCV0 on line 22 姓名 failed Warning: preg_match(): Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/8CCV0 on line 22 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/8CCV0 on line 22 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/8CCV0 on line 22 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/8CCV0 on line 22 john$ failed Warning: preg_match(): Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/8CCV0 on line 22 ee% failed Warning: preg_match(): Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/8CCV0 on line 22 e^ failed Warning: preg_match(): Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/8CCV0 on line 22 EE& failed Warning: preg_match(): Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/8CCV0 on line 22 EE( failed Warning: preg_match(): Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/8CCV0 on line 22 vivek 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/8CCV0 on line 22 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8CCV0 on line 23 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/8CCV0 on line 22 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8CCV0 on line 23 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/8CCV0 on line 22 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8CCV0 on line 23 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/8CCV0 on line 22 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8CCV0 on line 23 姓名 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/8CCV0 on line 22 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8CCV0 on line 23 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/8CCV0 on line 22 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8CCV0 on line 23 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/8CCV0 on line 22 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8CCV0 on line 23 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/8CCV0 on line 22 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8CCV0 on line 23 john$ 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/8CCV0 on line 22 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8CCV0 on line 23 ee% 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/8CCV0 on line 22 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8CCV0 on line 23 e^ 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/8CCV0 on line 22 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8CCV0 on line 23 EE& 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/8CCV0 on line 22 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8CCV0 on line 23 EE( 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/8CCV0 on line 22 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8CCV0 on line 23 vivek 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/8CCV0 on line 22 Mr Smith failed Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/8CCV0 on line 22 Mr. Smith failed Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/8CCV0 on line 22 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/8CCV0 on line 22 姓名 failed Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/8CCV0 on line 22 tom!!! failed Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/8CCV0 on line 22 Mary@ failed Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/8CCV0 on line 22 May# failed Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/8CCV0 on line 22 john$ failed Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/8CCV0 on line 22 ee% failed Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/8CCV0 on line 22 e^ failed Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/8CCV0 on line 22 EE& failed Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/8CCV0 on line 22 EE( failed Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/8CCV0 on line 22 vivek 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/8CCV0 on line 22 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8CCV0 on line 23 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/8CCV0 on line 22 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8CCV0 on line 23 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/8CCV0 on line 22 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8CCV0 on line 23 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/8CCV0 on line 22 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8CCV0 on line 23 姓名 failedPHP_EOL Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/8CCV0 on line 22 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8CCV0 on line 23 tom!!! failedPHP_EOL Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/8CCV0 on line 22 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8CCV0 on line 23 Mary@ failedPHP_EOL Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/8CCV0 on line 22 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8CCV0 on line 23 May# failedPHP_EOL Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/8CCV0 on line 22 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8CCV0 on line 23 john$ failedPHP_EOL Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/8CCV0 on line 22 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8CCV0 on line 23 ee% failedPHP_EOL Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/8CCV0 on line 22 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8CCV0 on line 23 e^ failedPHP_EOL Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/8CCV0 on line 22 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8CCV0 on line 23 EE& failedPHP_EOL Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/8CCV0 on line 22 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8CCV0 on line 23 EE( failedPHP_EOL Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 12 in /in/8CCV0 on line 22 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8CCV0 on line 23 vivek failedPHP_EOL