Arquivos
hhvm/hphp/test/vm/reflection_isclosure.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

35 linhas
583 B
PHP

<?php
function not_a_closure() {
return 1;
};
$rf = new ReflectionFunction('not_a_closure');
var_dump($rf->isClosure());
var_dump($rf->isGenerator());
function is_a_generator() {
yield 1;
yield 2;
};
$rf = new ReflectionFunction('is_a_generator');
var_dump($rf->isClosure());
var_dump($rf->isGenerator());
$cl = function() {
return 1;
};
$rf = new ReflectionFunction($cl);
var_dump($rf->isClosure());
var_dump($rf->isGenerator());
$cl = function() {
yield 1;
yield 2;
};
$rf = new ReflectionFunction($cl);
var_dump($rf->isClosure());
var_dump($rf->isGenerator());