Arquivos
hhvm/hphp/test/quick/multiple_closures.php
T
Jordan DeLong 6443636f36 Some optimizations for closure creation
Inline some of the things into the TC so it can be
specialized on the closure type.  Also avoids spilling everything to
the stack to call init (which just pulls it back off and puts it into
the heap), and uses AllocObjFast instead of newInstance.  (We can't
quite get the super-fast-path version of AllocObjFast because closures
are extension objects and for now trying to convince it not to use the
m_InstanceCtor is a bit lame---we should probably just generate the
classes as php-level classes at some point so that'll just work.)

Differential Revision: D894569
2013-07-30 10:40:05 -07:00

18 linhas
267 B
PHP

<?php
class foo {
public function bar() {
$z = function() {};
$zz = function() {};
$zzz = function() {};
$zzzz = function() {};
$zzzzz = function() {};
$zzzzzz = function() {};
}
}
function main() {
$l = new foo;
$l->bar();
}
main();