3v4l.org

run code in 300+ PHP versions simultaneously
<?php $int = 'x'; $bool = 'flase'; $string = 'false'; var_dump( filter_var($int, FILTER_VALIDATE_INT), filter_var($bool, FILTER_VALIDATE_BOOLEAN), filter_var($string, FILTER_VALIDATE_FLOAT), filter_var($string, FILTER_VALIDATE_URL), filter_var($string, FILTER_VALIDATE_IP), filter_var($int, FILTER_VALIDATE_INT, array('flags' => FILTER_NULL_ON_FAILURE)), filter_var($bool, FILTER_VALIDATE_BOOLEAN, array('flags' => FILTER_NULL_ON_FAILURE)), filter_var($string, FILTER_VALIDATE_FLOAT, array('flags' => FILTER_NULL_ON_FAILURE)), filter_var($string, FILTER_VALIDATE_URL, array('flags' => FILTER_NULL_ON_FAILURE)), filter_var($string, FILTER_VALIDATE_IP, array('flags' => FILTER_NULL_ON_FAILURE)) );

preferences:
79.34 ms | 405 KiB | 5 Q