xref: /PHP-8.2/Zend/tests/closure_call_bind.phpt (revision 4fcf0db6)
1--TEST--
2Calling bindTo() on __call() closure
3--FILE--
4<?php
5
6class Foo {
7    function __call($name, $args) {
8        echo "__call($name)\n";
9    }
10}
11
12$foo = new Foo;
13$name = "foo";
14Closure::fromCallable([$foo, $name . "bar"])->bindTo(new Foo)();
15$foo->{$name . "bar"}(...)->bindTo(new Foo)();
16
17?>
18--EXPECT--
19__call(foobar)
20__call(foobar)
21