1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/Zend/tests/closures/closure_call_bind.phpt
DanielEScherzer a50f82bebf Zend/tests: organize some tests with sub directories (6) (#17807)
Move more tests into existing directories

Work towards GH-15631
2025-02-15 14:55:07 +00:00

21 lines
339 B
PHP

--TEST--
Calling bindTo() on __call() closure
--FILE--
<?php
class Foo {
function __call($name, $args) {
echo "__call($name)\n";
}
}
$foo = new Foo;
$name = "foo";
Closure::fromCallable([$foo, $name . "bar"])->bindTo(new Foo)();
$foo->{$name . "bar"}(...)->bindTo(new Foo)();
?>
--EXPECT--
__call(foobar)
__call(foobar)