3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $s = 'Etui à fire farger'; var_dump(preg_replace("/\s{2,}/u", " ", $s)); var_dump(preg_replace("/\{Z}{2,}/u", " ", $s)); var_dump(preg_replace("/\{Zs}{2,}/u", " ", $s)); var_dump(preg_replace("/\P{Z}{2,}/u", " ", $s));
based on CgAjJ
Output for 4.4.0 - 4.4.9, 5.0.5 - 7.2.0
string(19) "Etui à fire farger" string(20) "Etui à fire farger" string(20) "Etui à fire farger" string(9) " à "
Output for 4.3.11, 5.0.0 - 5.0.4
string(19) "Etui à fire farger" string(20) "Etui à fire farger" string(20) "Etui à fire farger" Warning: preg_replace(): Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 1 in /in/1Ehjn on line 6 NULL
Output for 4.3.0 - 4.3.10
string(19) "Etui à fire farger" string(20) "Etui à fire farger" string(20) "Etui à fire farger" Warning: Compilation failed: PCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X at offset 1 in /in/1Ehjn on line 6 NULL