3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php error_reporting(-1); echo str_pad(__LINE__, 2, ' ', STR_PAD_LEFT), ': '; var_dump(filter_var('true', FILTER_VALIDATE_BOOLEAN)); echo str_pad(__LINE__, 2, ' ', STR_PAD_LEFT), ': '; var_dump(filter_var('TRUE', FILTER_VALIDATE_BOOLEAN)); echo str_pad(__LINE__, 2, ' ', STR_PAD_LEFT), ': '; var_dump(filter_var('on', FILTER_VALIDATE_BOOLEAN)); echo str_pad(__LINE__, 2, ' ', STR_PAD_LEFT), ': '; var_dump(filter_var('On', FILTER_VALIDATE_BOOLEAN)); echo str_pad(__LINE__, 2, ' ', STR_PAD_LEFT), ': '; var_dump(filter_var('1', FILTER_VALIDATE_BOOLEAN)); echo str_pad(__LINE__, 2, ' ', STR_PAD_LEFT), ': '; var_dump(filter_var('false', FILTER_VALIDATE_BOOLEAN)); echo str_pad(__LINE__, 2, ' ', STR_PAD_LEFT), ': '; var_dump(filter_var('FALSE', FILTER_VALIDATE_BOOLEAN)); echo str_pad(__LINE__, 2, ' ', STR_PAD_LEFT), ': '; var_dump(filter_var('off', FILTER_VALIDATE_BOOLEAN)); echo str_pad(__LINE__, 2, ' ', STR_PAD_LEFT), ': '; var_dump(filter_var('Off', FILTER_VALIDATE_BOOLEAN)); echo str_pad(__LINE__, 2, ' ', STR_PAD_LEFT), ': '; var_dump(filter_var('0', FILTER_VALIDATE_BOOLEAN)); echo str_pad(__LINE__, 2, ' ', STR_PAD_LEFT), ': '; var_dump(filter_var('', FILTER_VALIDATE_BOOLEAN)); echo str_pad(__LINE__, 2, ' ', STR_PAD_LEFT), ': '; var_dump(filter_var('true', FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE)); echo str_pad(__LINE__, 2, ' ', STR_PAD_LEFT), ': '; var_dump(filter_var('TRUE', FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE)); echo str_pad(__LINE__, 2, ' ', STR_PAD_LEFT), ': '; var_dump(filter_var('on', FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE)); echo str_pad(__LINE__, 2, ' ', STR_PAD_LEFT), ': '; var_dump(filter_var('On', FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE)); echo str_pad(__LINE__, 2, ' ', STR_PAD_LEFT), ': '; var_dump(filter_var('1', FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE)); echo str_pad(__LINE__, 2, ' ', STR_PAD_LEFT), ': '; var_dump(filter_var('false', FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE)); echo str_pad(__LINE__, 2, ' ', STR_PAD_LEFT), ': '; var_dump(filter_var('FALSE', FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE)); echo str_pad(__LINE__, 2, ' ', STR_PAD_LEFT), ': '; var_dump(filter_var('off', FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE)); echo str_pad(__LINE__, 2, ' ', STR_PAD_LEFT), ': '; var_dump(filter_var('Off', FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE)); echo str_pad(__LINE__, 2, ' ', STR_PAD_LEFT), ': '; var_dump(filter_var('0', FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE)); echo str_pad(__LINE__, 2, ' ', STR_PAD_LEFT), ': '; var_dump(filter_var('', FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE));
Output for 7.0.0 - 7.1.0
4: Notice: Use of undefined constant  FILTER_VALIDATE_BOOLEAN - assumed ' FILTER_VALIDATE_BOOLEAN' in /in/MRuRJ on line 4 Warning: filter_var() expects parameter 2 to be integer, string given in /in/MRuRJ on line 4 NULL 5: Notice: Use of undefined constant  FILTER_VALIDATE_BOOLEAN - assumed ' FILTER_VALIDATE_BOOLEAN' in /in/MRuRJ on line 5 Warning: filter_var() expects parameter 2 to be integer, string given in /in/MRuRJ on line 5 NULL 6: Notice: Use of undefined constant  FILTER_VALIDATE_BOOLEAN - assumed ' FILTER_VALIDATE_BOOLEAN' in /in/MRuRJ on line 6 Warning: filter_var() expects parameter 2 to be integer, string given in /in/MRuRJ on line 6 NULL 7: Notice: Use of undefined constant  FILTER_VALIDATE_BOOLEAN - assumed ' FILTER_VALIDATE_BOOLEAN' in /in/MRuRJ on line 7 Warning: filter_var() expects parameter 2 to be integer, string given in /in/MRuRJ on line 7 NULL 8: Notice: Use of undefined constant  FILTER_VALIDATE_BOOLEAN - assumed ' FILTER_VALIDATE_BOOLEAN' in /in/MRuRJ on line 8 Warning: filter_var() expects parameter 2 to be integer, string given in /in/MRuRJ on line 8 NULL 10: Notice: Use of undefined constant  FILTER_VALIDATE_BOOLEAN - assumed ' FILTER_VALIDATE_BOOLEAN' in /in/MRuRJ on line 10 Warning: filter_var() expects parameter 2 to be integer, string given in /in/MRuRJ on line 10 NULL 11: Notice: Use of undefined constant  FILTER_VALIDATE_BOOLEAN - assumed ' FILTER_VALIDATE_BOOLEAN' in /in/MRuRJ on line 11 Warning: filter_var() expects parameter 2 to be integer, string given in /in/MRuRJ on line 11 NULL 12: Notice: Use of undefined constant  FILTER_VALIDATE_BOOLEAN - assumed ' FILTER_VALIDATE_BOOLEAN' in /in/MRuRJ on line 12 Warning: filter_var() expects parameter 2 to be integer, string given in /in/MRuRJ on line 12 NULL 13: Notice: Use of undefined constant  FILTER_VALIDATE_BOOLEAN - assumed ' FILTER_VALIDATE_BOOLEAN' in /in/MRuRJ on line 13 Warning: filter_var() expects parameter 2 to be integer, string given in /in/MRuRJ on line 13 NULL 14: Notice: Use of undefined constant  FILTER_VALIDATE_BOOLEAN - assumed ' FILTER_VALIDATE_BOOLEAN' in /in/MRuRJ on line 14 Warning: filter_var() expects parameter 2 to be integer, string given in /in/MRuRJ on line 14 NULL 15: Notice: Use of undefined constant  FILTER_VALIDATE_BOOLEAN - assumed ' FILTER_VALIDATE_BOOLEAN' in /in/MRuRJ on line 15 Warning: filter_var() expects parameter 2 to be integer, string given in /in/MRuRJ on line 15 NULL 18: Notice: Use of undefined constant  FILTER_VALIDATE_BOOLEAN - assumed ' FILTER_VALIDATE_BOOLEAN' in /in/MRuRJ on line 18 Warning: filter_var() expects parameter 2 to be integer, string given in /in/MRuRJ on line 18 NULL 19: Notice: Use of undefined constant  FILTER_VALIDATE_BOOLEAN - assumed ' FILTER_VALIDATE_BOOLEAN' in /in/MRuRJ on line 19 Warning: filter_var() expects parameter 2 to be integer, string given in /in/MRuRJ on line 19 NULL 20: Notice: Use of undefined constant  FILTER_VALIDATE_BOOLEAN - assumed ' FILTER_VALIDATE_BOOLEAN' in /in/MRuRJ on line 20 Warning: filter_var() expects parameter 2 to be integer, string given in /in/MRuRJ on line 20 NULL 21: Notice: Use of undefined constant  FILTER_VALIDATE_BOOLEAN - assumed ' FILTER_VALIDATE_BOOLEAN' in /in/MRuRJ on line 21 Warning: filter_var() expects parameter 2 to be integer, string given in /in/MRuRJ on line 21 NULL 22: Notice: Use of undefined constant  FILTER_VALIDATE_BOOLEAN - assumed ' FILTER_VALIDATE_BOOLEAN' in /in/MRuRJ on line 22 Warning: filter_var() expects parameter 2 to be integer, string given in /in/MRuRJ on line 22 NULL 24: Notice: Use of undefined constant  FILTER_VALIDATE_BOOLEAN - assumed ' FILTER_VALIDATE_BOOLEAN' in /in/MRuRJ on line 24 Warning: filter_var() expects parameter 2 to be integer, string given in /in/MRuRJ on line 24 NULL 25: Notice: Use of undefined constant  FILTER_VALIDATE_BOOLEAN - assumed ' FILTER_VALIDATE_BOOLEAN' in /in/MRuRJ on line 25 Warning: filter_var() expects parameter 2 to be integer, string given in /in/MRuRJ on line 25 NULL 26: Notice: Use of undefined constant  FILTER_VALIDATE_BOOLEAN - assumed ' FILTER_VALIDATE_BOOLEAN' in /in/MRuRJ on line 26 Warning: filter_var() expects parameter 2 to be integer, string given in /in/MRuRJ on line 26 NULL 27: Notice: Use of undefined constant  FILTER_VALIDATE_BOOLEAN - assumed ' FILTER_VALIDATE_BOOLEAN' in /in/MRuRJ on line 27 Warning: filter_var() expects parameter 2 to be integer, string given in /in/MRuRJ on line 27 NULL 28: Notice: Use of undefined constant  FILTER_VALIDATE_BOOLEAN - assumed ' FILTER_VALIDATE_BOOLEAN' in /in/MRuRJ on line 28 Warning: filter_var() expects parameter 2 to be integer, string given in /in/MRuRJ on line 28 NULL 29: Notice: Use of undefined constant  FILTER_VALIDATE_BOOLEAN - assumed ' FILTER_VALIDATE_BOOLEAN' in /in/MRuRJ on line 29 Warning: filter_var() expects parameter 2 to be integer, string given in /in/MRuRJ on line 29 NULL
Output for 5.2.0 - 5.6.28
4: Notice: Use of undefined constant  FILTER_VALIDATE_BOOLEAN - assumed ' FILTER_VALIDATE_BOOLEAN' in /in/MRuRJ on line 4 Warning: filter_var() expects parameter 2 to be long, string given in /in/MRuRJ on line 4 NULL 5: Notice: Use of undefined constant  FILTER_VALIDATE_BOOLEAN - assumed ' FILTER_VALIDATE_BOOLEAN' in /in/MRuRJ on line 5 Warning: filter_var() expects parameter 2 to be long, string given in /in/MRuRJ on line 5 NULL 6: Notice: Use of undefined constant  FILTER_VALIDATE_BOOLEAN - assumed ' FILTER_VALIDATE_BOOLEAN' in /in/MRuRJ on line 6 Warning: filter_var() expects parameter 2 to be long, string given in /in/MRuRJ on line 6 NULL 7: Notice: Use of undefined constant  FILTER_VALIDATE_BOOLEAN - assumed ' FILTER_VALIDATE_BOOLEAN' in /in/MRuRJ on line 7 Warning: filter_var() expects parameter 2 to be long, string given in /in/MRuRJ on line 7 NULL 8: Notice: Use of undefined constant  FILTER_VALIDATE_BOOLEAN - assumed ' FILTER_VALIDATE_BOOLEAN' in /in/MRuRJ on line 8 Warning: filter_var() expects parameter 2 to be long, string given in /in/MRuRJ on line 8 NULL 10: Notice: Use of undefined constant  FILTER_VALIDATE_BOOLEAN - assumed ' FILTER_VALIDATE_BOOLEAN' in /in/MRuRJ on line 10 Warning: filter_var() expects parameter 2 to be long, string given in /in/MRuRJ on line 10 NULL 11: Notice: Use of undefined constant  FILTER_VALIDATE_BOOLEAN - assumed ' FILTER_VALIDATE_BOOLEAN' in /in/MRuRJ on line 11 Warning: filter_var() expects parameter 2 to be long, string given in /in/MRuRJ on line 11 NULL 12: Notice: Use of undefined constant  FILTER_VALIDATE_BOOLEAN - assumed ' FILTER_VALIDATE_BOOLEAN' in /in/MRuRJ on line 12 Warning: filter_var() expects parameter 2 to be long, string given in /in/MRuRJ on line 12 NULL 13: Notice: Use of undefined constant  FILTER_VALIDATE_BOOLEAN - assumed ' FILTER_VALIDATE_BOOLEAN' in /in/MRuRJ on line 13 Warning: filter_var() expects parameter 2 to be long, string given in /in/MRuRJ on line 13 NULL 14: Notice: Use of undefined constant  FILTER_VALIDATE_BOOLEAN - assumed ' FILTER_VALIDATE_BOOLEAN' in /in/MRuRJ on line 14 Warning: filter_var() expects parameter 2 to be long, string given in /in/MRuRJ on line 14 NULL 15: Notice: Use of undefined constant  FILTER_VALIDATE_BOOLEAN - assumed ' FILTER_VALIDATE_BOOLEAN' in /in/MRuRJ on line 15 Warning: filter_var() expects parameter 2 to be long, string given in /in/MRuRJ on line 15 NULL 18: Notice: Use of undefined constant  FILTER_VALIDATE_BOOLEAN - assumed ' FILTER_VALIDATE_BOOLEAN' in /in/MRuRJ on line 18 Warning: filter_var() expects parameter 2 to be long, string given in /in/MRuRJ on line 18 NULL 19: Notice: Use of undefined constant  FILTER_VALIDATE_BOOLEAN - assumed ' FILTER_VALIDATE_BOOLEAN' in /in/MRuRJ on line 19 Warning: filter_var() expects parameter 2 to be long, string given in /in/MRuRJ on line 19 NULL 20: Notice: Use of undefined constant  FILTER_VALIDATE_BOOLEAN - assumed ' FILTER_VALIDATE_BOOLEAN' in /in/MRuRJ on line 20 Warning: filter_var() expects parameter 2 to be long, string given in /in/MRuRJ on line 20 NULL 21: Notice: Use of undefined constant  FILTER_VALIDATE_BOOLEAN - assumed ' FILTER_VALIDATE_BOOLEAN' in /in/MRuRJ on line 21 Warning: filter_var() expects parameter 2 to be long, string given in /in/MRuRJ on line 21 NULL 22: Notice: Use of undefined constant  FILTER_VALIDATE_BOOLEAN - assumed ' FILTER_VALIDATE_BOOLEAN' in /in/MRuRJ on line 22 Warning: filter_var() expects parameter 2 to be long, string given in /in/MRuRJ on line 22 NULL 24: Notice: Use of undefined constant  FILTER_VALIDATE_BOOLEAN - assumed ' FILTER_VALIDATE_BOOLEAN' in /in/MRuRJ on line 24 Warning: filter_var() expects parameter 2 to be long, string given in /in/MRuRJ on line 24 NULL 25: Notice: Use of undefined constant  FILTER_VALIDATE_BOOLEAN - assumed ' FILTER_VALIDATE_BOOLEAN' in /in/MRuRJ on line 25 Warning: filter_var() expects parameter 2 to be long, string given in /in/MRuRJ on line 25 NULL 26: Notice: Use of undefined constant  FILTER_VALIDATE_BOOLEAN - assumed ' FILTER_VALIDATE_BOOLEAN' in /in/MRuRJ on line 26 Warning: filter_var() expects parameter 2 to be long, string given in /in/MRuRJ on line 26 NULL 27: Notice: Use of undefined constant  FILTER_VALIDATE_BOOLEAN - assumed ' FILTER_VALIDATE_BOOLEAN' in /in/MRuRJ on line 27 Warning: filter_var() expects parameter 2 to be long, string given in /in/MRuRJ on line 27 NULL 28: Notice: Use of undefined constant  FILTER_VALIDATE_BOOLEAN - assumed ' FILTER_VALIDATE_BOOLEAN' in /in/MRuRJ on line 28 Warning: filter_var() expects parameter 2 to be long, string given in /in/MRuRJ on line 28 NULL 29: Notice: Use of undefined constant  FILTER_VALIDATE_BOOLEAN - assumed ' FILTER_VALIDATE_BOOLEAN' in /in/MRuRJ on line 29 Warning: filter_var() expects parameter 2 to be long, string given in /in/MRuRJ on line 29 NULL
Output for 5.0.0 - 5.1.6
4: Fatal error: Call to undefined function filter_var() in /in/MRuRJ on line 4
Process exited with code 255.
Output for 4.4.5 - 4.4.9
4: Fatal error: Call to undefined function: filter_var() in /in/MRuRJ on line 4
Process exited with code 255.
Output for 4.3.2 - 4.4.4
4: Fatal error: Call to undefined function: filter_var() in /in/MRuRJ on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1
4: Fatal error: Call to undefined function: filter_var() in /in/MRuRJ on line 4