Arquivos
hhvm/hphp/test/slow/reflection_classes/1365.php
T
Paul Tarjan c2ec1c97c9 sortof format slow tests
A poor man's formatter since I didn't like any of the other ones I found. The original C++ source sometimes put newlines and sometimes not.

Codemods:

    codemod '([;{}])([^\n])' '\1\n\2'
    codemod -m '\s*<\?php\s+' '<?php\n\n'
    codemod '\t' '  '

I hand-fixed all the failing tests
2013-05-30 17:32:57 -07:00

34 linhas
610 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());