3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a[1] = 'lolol'; $a[2] = '1l1l1l'; $a[3] = '<p>dasdsa</p>'; $a[4] = 'assa"".**&'; function protect(){ addslashes($a); array_map('strip_tags',$a); } protect($a); var_dump($a); return $a;
Output for 5.0.4 - 7.1.0
Notice: Undefined variable: a in /in/cBXQ6 on line 9 Notice: Undefined variable: a in /in/cBXQ6 on line 10 Warning: array_map(): Argument #2 should be an array in /in/cBXQ6 on line 10 array(4) { [1]=> string(5) "lolol" [2]=> string(6) "1l1l1l" [3]=> string(13) "<p>dasdsa</p>" [4]=> string(10) "assa"".**&" }
Output for 4.3.2 - 5.0.3
Notice: Undefined variable: a in /in/cBXQ6 on line 9 Notice: Undefined variable: a in /in/cBXQ6 on line 10 Warning: array_map(): Argument #2 should be an array in /in/cBXQ6 on line 10 array(4) { [1]=> string(5) "lolol" [2]=> string(6) "1l1l1l" [3]=> string(13) "<p>dasdsa</p>" [4]=> string(10) "assa"".**&" }
Output for 4.3.0 - 4.3.1
Notice: Undefined variable: a in /in/cBXQ6 on line 9 Notice: Undefined variable: a in /in/cBXQ6 on line 10 Warning: array_map() [http://www.php.net/function.array-map]: Argument #2 should be an array in /in/cBXQ6 on line 10 array(4) { [1]=> string(5) "lolol" [2]=> string(6) "1l1l1l" [3]=> string(13) "<p>dasdsa</p>" [4]=> string(10) "assa"".**&" }