菜谱项目

GeneratorDemo.php 270B

12345678910111213141516171819202122
  1. <?php
  2. namespace Symfony\Component\VarDumper\Tests\Fixtures;
  3. class GeneratorDemo
  4. {
  5. public static function foo()
  6. {
  7. yield 1;
  8. }
  9. public function baz()
  10. {
  11. yield from bar();
  12. }
  13. }
  14. function bar()
  15. {
  16. yield from GeneratorDemo::foo();
  17. }