3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php declare(strict_types=1); function bla(int $i):int { return $i; } var_dump(bla(5)); var_dump(bla('a'));
based on gQG0E
Output for 7.0.0 - 7.2.0
int(5) Fatal error: Uncaught TypeError: Argument 1 passed to bla() must be of the type integer, string given, called in /in/Gk5Tj on line 10 and defined in /in/Gk5Tj:5 Stack trace: #0 /in/Gk5Tj(10): bla('a') #1 {main} thrown in /in/Gk5Tj on line 5
Process exited with code 255.
Output for 5.3.19 - 5.6.28
Warning: Unsupported declare 'strict_types' in /in/Gk5Tj on line 3 Parse error: syntax error, unexpected ':', expecting '{' in /in/Gk5Tj on line 5
Process exited with code 255.