3v4l.org

run code in 300+ PHP versions simultaneously
<?php function my_func(int $n) { var_dump($n); } my_func('6'); // => (int) 6 my_func(3.1415); // => (int) 3 my_func(TRUE); // => (int) 1 my_func([]); // => (int) 1 my_func(NULL); // => Fatal error: Uncaught TypeError: Argument 1 passed to my_func() must be of the type integer, null given.

preferences:
41.97 ms | 402 KiB | 5 Q