3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $generator = function ($bytes) { for ($i = 0; $i < $bytes; $i++) { yield '.'; } }; var_dump( get_class_methods($generator(10)) );
based on 34nKV
Output for 7.0.0 - 7.2.0
array(9) { [0]=> string(6) "rewind" [1]=> string(5) "valid" [2]=> string(7) "current" [3]=> string(3) "key" [4]=> string(4) "next" [5]=> string(4) "send" [6]=> string(5) "throw" [7]=> string(9) "getReturn" [8]=> string(8) "__wakeup" }
Output for 5.5.24 - 5.6.28
array(8) { [0]=> string(6) "rewind" [1]=> string(5) "valid" [2]=> string(7) "current" [3]=> string(3) "key" [4]=> string(4) "next" [5]=> string(4) "send" [6]=> string(5) "throw" [7]=> string(8) "__wakeup" }
Output for 5.4.11 - 5.4.45
Parse error: syntax error, unexpected ''.'' (T_CONSTANT_ENCAPSED_STRING) in /in/mv3uE on line 5
Process exited with code 255.
Output for 5.3.21 - 5.3.29
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /in/mv3uE on line 5
Process exited with code 255.