3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function receive(): iterable { var_dump(yield 0); var_dump(yield 1); var_dump(yield 2); } foreach (receive() as $i) {}
based on GIVAP
Output for 7.1.0 - 7.3.0rc3
NULL NULL NULL
Output for 7.0.0 - 7.0.27
Fatal error: Generators may only declare a return type of Generator, Iterator or Traversable, iterable is not permitted in /in/51jhv on line 5
Process exited with code 255.
Output for hhvm-3.22.0
Fatal error: Uncaught Error: syntax error, unexpected T_YIELD, expecting ')' in /in/51jhv:-1 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.18.5 - 3.21.3
Fatal error: Uncaught Error: syntax error, unexpected T_YIELD, expecting ')' in /in/51jhv:5 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Parse error: syntax error, unexpected ':', expecting '{' in /in/51jhv on line 3
Process exited with code 255.