Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 26 lines (24 sloc) 0.353 kB
36ec348 Closure::__invoke() is fixed to support references
Dmitry Stogov authored
1 --TEST--
2 Closure 013: __invoke() on temporary result
3 --FILE--
4 <?php
5 class Foo {
6 function __invoke() {
7 echo "Hello World!\n";
8 }
9 }
10
11 function foo() {
12 return function() {
13 echo "Hello World!\n";
14 };
15 }
16 $test = new Foo;
17 $test->__invoke();
18 $test = foo();
19 $test->__invoke();
20 $test = foo()->__invoke();
21 ?>
22 --EXPECT--
23 Hello World!
24 Hello World!
25 Hello World!
Something went wrong with that request. Please try again.