3v4l.org

run code in 300+ PHP versions simultaneously
<?php function f($data) { var_dump($data); var_dump(filter_var($data, FILTER_VALIDATE_INT)); echo PHP_EOL; } f(null); f(false); f(0); f("0"); f(1); f("1"); f(array()); f(array(0)); f(array(1)); class ToStringAble { function __toString() { return "0"; } } f(new ToStringAble()); f(new stdclass());

preferences:
57.27 ms | 405 KiB | 5 Q