3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $string = "ABCDE "; echo trim($string)."\n"; echo preg_replace('/\s+/', '', $string)."\n"; echo preg_replace('/\s\s+/', '', $string)."\n"; echo trim(preg_replace('/[\s\t\n\r\s]+/', '', $string))."\n"; echo preg_replace('/~\x{00a0}~siu/', '', $string);
based on TiFEW
Output for 4.3.0 - 7.1.0
ABCDE ABCDE ABCDE ABCDE ABCDE