3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_dump(phpversion()); function teste ($arg) { $var = function() use ($arg) { if(!filter_var($arg, FILTER_VALIDATE_INT)){ throw new Exception("It\'s not a INT\n"); } if($arg % 2 == 0) return 'PAR'; return 'IMPAR'; }; return $var(); } echo teste(27); echo teste(18); //echo teste('a');

preferences:
32.67 ms | 402 KiB | 5 Q