1
0
mirror of https://github.com/php/php-src.git synced 2026-04-17 21:11:02 +02:00
Files
archived-php-src/Zend/tests/closures/closure_from_callable_rebinding.phpt
2016-07-05 15:13:51 +02:00

21 lines
330 B
PHP

--TEST--
Testing Closure::fromCallable() functionality: Rebinding
--FILE--
<?php
class A {
public function method() {
var_dump($this);
}
}
class B {
}
$fn = Closure::fromCallable([new A, 'method']);
$fn->call(new B);
?>
--EXPECTF--
Warning: Cannot bind method A::method() to object of class B in %s on line %d