3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function f(int $a, int $b) : void { var_dump($a, $b); } f(1, '2');
based on msS8S
Output for 7.1.0 - 7.2.6
int(1) int(2)
Output for 7.0.0 - 7.0.20
int(1) int(2) Fatal error: Uncaught TypeError: Return value of f() must be an instance of void, none returned in /in/1ZXlq:5 Stack trace: #0 /in/1ZXlq(7): f(1, 2) #1 {main} thrown in /in/1ZXlq on line 5
Process exited with code 255.
Output for hhvm-3.15.4
int(1) int(2) Fatal error: Uncaught TypeError: Value returned from function f() must be of type void, null given in /in/1ZXlq:5 Stack trace: #0 /in/1ZXlq(7): f() #1 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Parse error: syntax error, unexpected ':', expecting '{' in /in/1ZXlq on line 3
Process exited with code 255.