3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function returnInt(): int { return a; } echo returnInt() + 3;
based on AufO2
Output for 7.2.0
Warning: Use of undefined constant a - assumed 'a' (this will throw an Error in a future version of PHP) in /in/k7N7h on line 5 Fatal error: Uncaught TypeError: Return value of returnInt() must be of the type integer, string returned in /in/k7N7h:5 Stack trace: #0 /in/k7N7h(8): returnInt() #1 {main} thrown in /in/k7N7h on line 5
Process exited with code 255.
Output for 7.0.0 - 7.1.10
Notice: Use of undefined constant a - assumed 'a' in /in/k7N7h on line 5 Fatal error: Uncaught TypeError: Return value of returnInt() must be of the type integer, string returned in /in/k7N7h:5 Stack trace: #0 /in/k7N7h(8): returnInt() #1 {main} thrown in /in/k7N7h on line 5
Process exited with code 255.
Output for 5.3.21 - 5.6.28
Parse error: syntax error, unexpected ':', expecting '{' in /in/k7N7h on line 3
Process exited with code 255.