3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function fun(integer $int): integer { return $int; } fun((int) true);
based on Le0lo
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught TypeError: Argument 1 passed to fun() must be an instance of integer, integer given, called in /in/LXHs8 on line 4 and defined in /in/LXHs8:3 Stack trace: #0 /in/LXHs8(4): fun(1) #1 {main} thrown in /in/LXHs8 on line 3
Process exited with code 255.
Output for 5.3.20 - 5.6.28
Parse error: syntax error, unexpected ':', expecting '{' in /in/LXHs8 on line 3
Process exited with code 255.