xref: /PHP-7.2/Zend/tests/closure_013.phpt (revision d5ef2f46)
1--TEST--
2Closure 013: __invoke() on temporary result
3--FILE--
4<?php
5class Foo {
6	function __invoke() {
7		echo "Hello World!\n";
8	}
9}
10
11function 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--
23Hello World!
24Hello World!
25Hello World!
26