3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php echo preg_replace('@(?=\pLm)@u', '*', 'م'), PHP_EOL; // prints: '*م' ✓ echo preg_replace('@(?=\pLm)@u', '*', 'ض'), PHP_EOL; // prints: '*ض' ✓ echo preg_replace('@(?=\pLm)@u', '*', 'غ'), PHP_EOL; // prints: '*�*�' ✗ echo preg_replace('@(?=\pLm)@u', '*', 'ص'), PHP_EOL; // prints: '*�*�' ✗
Output for 4.4.0 - 4.4.9, 5.0.5, 5.1.1 - 7.1.0
م ض غ ص
Output for 5.1.0
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/k4QtD on line 6
Process exited with code 255.
Output for 4.3.11, 5.0.2 - 5.0.4
Warning: preg_replace(): Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 4 in /in/k4QtD on line 3 Warning: preg_replace(): Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 4 in /in/k4QtD on line 4 Warning: preg_replace(): Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 4 in /in/k4QtD on line 5 Warning: preg_replace(): Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 4 in /in/k4QtD on line 6
Output for 5.0.0 - 5.0.1
Warning: preg_replace(): Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 4 in /in/k4QtD on line 3 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/k4QtD on line 3 PHP_EOL Warning: preg_replace(): Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 4 in /in/k4QtD on line 4 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/k4QtD on line 4 PHP_EOL Warning: preg_replace(): Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 4 in /in/k4QtD on line 5 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/k4QtD on line 5 PHP_EOL Warning: preg_replace(): Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 4 in /in/k4QtD on line 6 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/k4QtD on line 6 PHP_EOL
Output for 4.3.10
Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 4 in /in/k4QtD on line 3 Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 4 in /in/k4QtD on line 4 Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 4 in /in/k4QtD on line 5 Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 4 in /in/k4QtD on line 6
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 4 in /in/k4QtD on line 3 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/k4QtD on line 3 PHP_EOL Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 4 in /in/k4QtD on line 4 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/k4QtD on line 4 PHP_EOL Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 4 in /in/k4QtD on line 5 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/k4QtD on line 5 PHP_EOL Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 4 in /in/k4QtD on line 6 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/k4QtD on line 6 PHP_EOL