3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $r = array(); $org = ' valid_The Cat-Name%'.PHP_EOL; $r[] = $org; $filter = filter_var($org, FILTER_SANITIZE_SPECIAL_CHARS, FILTER_FLAG_STRIP_LOW | FILTER_FLAG_STRIP_HIGH); $r[] = $filter; $trim = trim($filter); $r[] = $trim; $mv_space = str_replace(' ', '-', $trim); $r[] = $mv_space; $rm_w = str_replace(array("\n", "\r", "\t"), '', $mv_space); $r[] = $rm_w; $lower = strtolower($rm_w); $r[] = $lower; var_dump($r);
Output for 5.2.0 - 5.6.28, 7.0.0 - 7.1.0
array(6) { [0]=> string(21) " valid_The Cat-Name% " [1]=> string(20) " valid_The Cat-Name%" [2]=> string(19) "valid_The Cat-Name%" [3]=> string(19) "valid_The-Cat-Name%" [4]=> string(19) "valid_The-Cat-Name%" [5]=> string(19) "valid_the-cat-name%" }
Output for hhvm-3.12.0
array(6) { [0]=> string(21) " valid_The Cat-Name% " [1]=> string(25) " valid_The Cat-Name%&#10;" [2]=> string(24) "valid_The Cat-Name%&#10;" [3]=> string(24) "valid_The-Cat-Name%&#10;" [4]=> string(24) "valid_The-Cat-Name%&#10;" [5]=> string(24) "valid_the-cat-name%&#10;" }
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.0.2 - 5.1.6
Fatal error: Call to undefined function filter_var() in /in/qQUDX on line 9
Process exited with code 255.
Output for 5.0.0 - 5.0.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/qQUDX on line 6 Fatal error: Call to undefined function filter_var() in /in/qQUDX on line 9
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: filter_var() in /in/qQUDX on line 9
Process exited with code 255.
Output for 4.3.10 - 4.4.4
Fatal error: Call to undefined function: filter_var() in /in/qQUDX on line 9
Process exited with code 255.
Output for 4.3.2 - 4.3.9
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/qQUDX on line 6 Fatal error: Call to undefined function: filter_var() in /in/qQUDX on line 9
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/qQUDX on line 6 Fatal error: Call to undefined function: filter_var() in /in/qQUDX on line 9