3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function x() { yield null; } function y(string $ok) { print $ok; } y(x());
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught TypeError: Argument 1 passed to y() must be of the type string, object given, called in /in/4S9sX on line 13 and defined in /in/4S9sX:8 Stack trace: #0 /in/4S9sX(13): y(Object(Generator)) #1 {main} thrown in /in/4S9sX on line 8
Process exited with code 255.
Output for 5.5.24 - 5.6.28
Catchable fatal error: Argument 1 passed to y() must be an instance of string, instance of Generator given, called in /in/4S9sX on line 13 and defined in /in/4S9sX on line 8
Process exited with code 255.
Output for 5.4.0 - 5.4.45
Parse error: syntax error, unexpected 'null' (T_STRING) in /in/4S9sX on line 5
Process exited with code 255.
Output for 5.3.19 - 5.3.29
Parse error: syntax error, unexpected T_STRING in /in/4S9sX on line 5
Process exited with code 255.