3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $type = 'login'; $edit = 'wolf'; echo FormValid($data,$type); function FormValid($data,$type){ switch($type){ case 'login': $edit = preg_replace("/[^A-Za-z0-9]/u", "", $data); break; case 'password': $edit = preg_replace("/[^A-Za-z0-9-_.,]/", "", $data); break; } if($data != $edit){ return false; } else{ return $data; }; }
Output for 5.0.4 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Notice: Undefined variable: data in /in/6Vc7Z on line 4
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: data in /in/6Vc7Z on line 4