3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php declare(strict_types=0); class Test{ function function1():int{ return 'dick'; } } $test = new Test(); echo $test->function1();
based on 8E6No
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught TypeError: Return value of Test::function1() must be of the type integer, string returned in /in/IsIgF:8 Stack trace: #0 /in/IsIgF(14): Test->function1() #1 {main} thrown in /in/IsIgF on line 8
Process exited with code 255.
Output for 5.3.21 - 5.6.28
Warning: Unsupported declare 'strict_types' in /in/IsIgF on line 2 Parse error: syntax error, unexpected ':', expecting ';' or '{' in /in/IsIgF on line 7
Process exited with code 255.