Arquivos
hhvm/hphp/test/vm/generator_method.php
T
Jordan Delong 363d1bb20f Code move src/ -> hphp/
This change is mostly for FB internal organizational reasons.
Building is not effected beyond the fact that the target now
lands in hphp/hhvm/hhvm rather than src/hhvm/hhvm.
2013-02-11 02:10:41 -08:00

19 linhas
317 B
PHP

<?php
class A {
public function gen() {
var_dump($this);
yield 1; yield 2; yield 3;
}
public static function sgen() {
var_dump(get_called_class());
yield 4; yield 5; yield 6;
}
}
$a = new A();
foreach ($a->gen() as $num) { var_dump($num); }
foreach (A::sgen() as $num) { var_dump($num); }