Arquivos
hhvm/hphp/test/slow/inlining/static_functions.php
T
Sean Cannella 6b2f9631b3 enable inlining for (most) static functions
- Enables inlining for existing function shapes for static calls except:
  1) static calls with a 'this' (as the refcounts become wrong)
2013-06-18 16:23:28 -07:00

30 linhas
435 B
PHP

<?php
final class Constants {
public static function gen1() {
yield 'foo';
}
public static function gen2() {
yield 'bar';
}
public static function gen3($s) {
yield $s;
}
}
function main() {
$g = Constants::gen1();
$g->next();
var_dump($g->current());
$g = Constants::gen2();
$g->next();
var_dump($g->current());
$g = Constants::gen3("baz");
$g->next();
var_dump($g->current());
}
main();