3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $s = "hé \r\n\t\xC2\xA0"; var_dump($s); var_dump(trim($s)); var_dump(preg_replace('/^\s+|\s+$/', '', $s)); var_dump(preg_replace('/^\s+|\s+$/u', '', $s));
Output for 5.3.4 - 7.1.0
string(9) "hé  " string(9) "hé  " string(9) "hé  " string(3) "hé"
Output for 4.3.0 - 5.3.3
string(9) "hé  " string(9) "hé  " string(9) "hé  " string(9) "hé  "