3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php declare(strict_types = 1); function a() : bool { return 1; } a();
based on SNgUH
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught TypeError: Return value of a() must be of the type boolean, integer returned in /in/g6ig9:5 Stack trace: #0 /in/g6ig9(7): a() #1 {main} thrown in /in/g6ig9 on line 5
Process exited with code 255.
Output for 5.3.21 - 5.6.28
Warning: Unsupported declare 'strict_types' in /in/g6ig9 on line 2 Parse error: syntax error, unexpected ':', expecting '{' in /in/g6ig9 on line 3
Process exited with code 255.