3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $r = array(); $org = 'valid-name'; $r[] = $org; $filter = filter_var($org, FILTER_UNSAFE_RAW, 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; var_dump($r);
Output for 5.2.0 - 7.1.0
array(5) { [0]=> string(10) "valid-name" [1]=> string(10) "valid-name" [2]=> string(10) "valid-name" [3]=> string(10) "valid-name" [4]=> string(10) "valid-name" }
Output for 5.0.0 - 5.1.6
Fatal error: Call to undefined function filter_var() in /in/T08FB 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/T08FB on line 9
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: filter_var() in /in/T08FB on line 9
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: filter_var() in /in/T08FB on line 9