3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function fn($input) { $array = [1,3]; while (true) { yield in_array($input, $array); } } var_dump(fn(1)); var_dump(fn(2)); var_dump(fn(3));
based on RWeST
Output for 5.5.0 - 7.3.0rc3
object(Generator)#1 (0) { } object(Generator)#1 (0) { } object(Generator)#1 (0) { }