summaryrefslogtreecommitdiff
path: root/Zend/tests/closures/closure_from_callable_rebinding.phpt
blob: 6fb5c6ffc1d0c3cbe0dfaaea2db9cc16ed591557 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
--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