TypePHP 编译器 https://swoole.com/aot/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

28 lines
418 B

--TEST--
Closure 013: __invoke() on temporary result
--FILE--
<?php
class Foo {
function __invoke() {
echo "Hello World!\n";
}
}
function foo() {
return function() {
echo "Hello World!\n";
};
}
function main() {
$test = new Foo;
$test->__invoke();
$test = foo();
$test->__invoke();
$test = foo()->__invoke();
}
?>
--EXPECT--
Hello World!
Hello World!
Hello World!