3v4l.org

run code in 300+ PHP versions simultaneously
<?php $test = array( 0, '', '0', 1, '1', '1.1', '1a1', '1e1', 'asdf' ); $result = array(); foreach ($test as $val) { $result[] = filter_input($val, FILTER_VALIDATE_FLOAT); } var_dump($test);
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.19, 8.3.0 - 8.3.7
Fatal error: Uncaught TypeError: filter_input(): Argument #1 ($type) must be of type int, string given in /in/75th2:18 Stack trace: #0 /in/75th2(18): filter_input('', 259) #1 {main} thrown in /in/75th2 on line 18
Process exited with code 255.
Output for 7.3.16 - 7.3.31, 7.4.0 - 7.4.33
Warning: filter_input() expects parameter 1 to be int, string given in /in/75th2 on line 18 Notice: A non well formed numeric value encountered in /in/75th2 on line 18 Warning: filter_input() expects parameter 1 to be int, string given in /in/75th2 on line 18 array(9) { [0]=> int(0) [1]=> string(0) "" [2]=> string(1) "0" [3]=> int(1) [4]=> string(1) "1" [5]=> string(3) "1.1" [6]=> string(3) "1a1" [7]=> string(3) "1e1" [8]=> string(4) "asdf" }
Output for 7.3.32 - 7.3.33
Warning: filter_input() expects parameter 1 to be int, string given in /in/75th2 on line 18 Warning: filter_input() expects parameter 1 to be int, string given in /in/75th2 on line 18 array(9) { [0]=> int(0) [1]=> string(0) "" [2]=> string(1) "0" [3]=> int(1) [4]=> string(1) "1" [5]=> string(3) "1.1" [6]=> string(3) "1a1" [7]=> string(3) "1e1" [8]=> string(4) "asdf" }
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33
Warning: filter_input() expects parameter 1 to be integer, string given in /in/75th2 on line 18 Notice: A non well formed numeric value encountered in /in/75th2 on line 18 Warning: filter_input() expects parameter 1 to be integer, string given in /in/75th2 on line 18 array(9) { [0]=> int(0) [1]=> string(0) "" [2]=> string(1) "0" [3]=> int(1) [4]=> string(1) "1" [5]=> string(3) "1.1" [6]=> string(3) "1a1" [7]=> string(3) "1e1" [8]=> string(4) "asdf" }
Output for 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.24 - 5.5.35, 5.6.8 - 5.6.28
Warning: filter_input() expects parameter 1 to be long, string given in /in/75th2 on line 18 Notice: A non well formed numeric value encountered in /in/75th2 on line 18 Warning: filter_input() expects parameter 1 to be long, string given in /in/75th2 on line 18 array(9) { [0]=> int(0) [1]=> string(0) "" [2]=> string(1) "0" [3]=> int(1) [4]=> string(1) "1" [5]=> string(3) "1.1" [6]=> string(3) "1a1" [7]=> string(3) "1e1" [8]=> string(4) "asdf" }
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6
Fatal error: Call to undefined function filter_input() in /in/75th2 on line 18
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: filter_input() in /in/75th2 on line 18
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.4
Fatal error: Call to undefined function: filter_input() in /in/75th2 on line 18
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: filter_input() in /in/75th2 on line 18

preferences:
208.58 ms | 401 KiB | 314 Q