3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php declare(strict_types=1); function test() : int { return '1'; } echo test;
based on Pkt9k
Output for 7.2.0
Warning: Use of undefined constant test - assumed 'test' (this will throw an Error in a future version of PHP) in /in/jYuBl on line 7 test
Output for 7.0.0 - 7.1.10
Notice: Use of undefined constant test - assumed 'test' in /in/jYuBl on line 7 test
Output for 5.3.21 - 5.6.28
Warning: Unsupported declare 'strict_types' in /in/jYuBl on line 2 Parse error: syntax error, unexpected ':', expecting '{' in /in/jYuBl on line 3
Process exited with code 255.