3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php declare(strict_types = 1); function bug(int $test) : \Generator { if (false) { yield 1; } } bug('a');
Output for 7.1.0 - 7.1.7
Fatal error: Uncaught TypeError: Argument 1 passed to bug() must be of the type integer, string given, called in /in/YLcKS on line 11 and defined in /in/YLcKS:4 Stack trace: #0 /in/YLcKS(11): bug('a') #1 {main} thrown in /in/YLcKS on line 4
Process exited with code 255.
Output for 7.0.0 - 7.0.20
Output for hhvm-3.11.1 - 3.17.3
Fatal error: Uncaught TypeError: Argument 1 passed to bug() must be an instance of int, string given in /in/YLcKS:9 Stack trace: #0 /in/YLcKS(11): bug() #1 {main}
Process exited with code 255.
Output for hhvm-3.10.1
Fatal error: Syntax only allowed in Hack files (<?hh) or with -v Eval.EnableHipHopSyntax=true in /in/YLcKS on line 4
Process exited with code 255.
Output for 5.3.0 - 5.6.30
Warning: Unsupported declare 'strict_types' in /in/YLcKS on line 2 Parse error: syntax error, unexpected ':', expecting '{' in /in/YLcKS on line 4
Process exited with code 255.
Output for 5.1.0 - 5.2.17
Parse error: syntax error, unexpected ':', expecting '{' in /in/YLcKS on line 4
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Parse error: parse error, unexpected ':', expecting '{' in /in/YLcKS on line 4
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting ')' in /in/YLcKS on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting ')' in /in/YLcKS on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `')'' in /in/YLcKS on line 4
Process exited with code 255.