Arquivos
hhvm/hphp/test/quick/trait_two_use_closure.php
T
Paul Tarjan 269ec416d5 Rename closures and generators - take 3
This reverts commit 2e9677b7c3f37e9627b9cbc9a6ddec82a10e7215.

Third time is the charm. I hid it from reflection, but I missed `get_class_methods`.

The diff betweenn this and what was reverted is https://phabricator.fb.com/P2217891 and then I did https://phabricator.fb.com/P2217904 because it looked like it should be done.
2013-06-12 11:34:39 -07:00

22 linhas
243 B
PHP

<?php
trait A {
function b() {
$c = function() {
return 'd';
};
var_dump($c);
return $c();
}
}
class E { use A; }
class F { use A; }
function main() {
var_dump((new E)->b());
var_dump((new F)->b());
}
main();