3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function test(): void { return void; } test();
based on PUqJA
Output for 7.1.0 - 7.2.0
Fatal error: A void function must not return a value in /in/9PmmL on line 5
Process exited with code 255.
Output for 7.0.0 - 7.0.26
Notice: Use of undefined constant void - assumed 'void' in /in/9PmmL on line 5 Fatal error: Uncaught TypeError: Return value of test() must be an instance of void, string returned in /in/9PmmL:5 Stack trace: #0 /in/9PmmL(8): test() #1 {main} thrown in /in/9PmmL on line 5
Process exited with code 255.
Output for hhvm-3.22.0
Notice: Use of undefined constant void - assumed 'void' in /in/9PmmL on line -1
Output for hhvm-3.21.0 - 3.21.3
Notice: Use of undefined constant void - assumed 'void' in /in/9PmmL on line 5
Output for hhvm-3.15.4 - 3.20.2
Notice: Use of undefined constant void - assumed 'void' in /in/9PmmL on line 5 Fatal error: Uncaught TypeError: Value returned from function test() must be of type void, string given in /in/9PmmL:5 Stack trace: #0 /in/9PmmL(8): test() #1 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Parse error: syntax error, unexpected ':', expecting '{' in /in/9PmmL on line 3
Process exited with code 255.