source: src/router/php7/Zend/tests/closures/closure_from_callable_rebinding.phpt @ 31874

Last change on this file since 31874 was 31874, checked in by brainslayer, 6 weeks ago

update php

File size: 330 bytes
Line 
1--TEST--
2Testing Closure::fromCallable() functionality: Rebinding
3--FILE--
4<?php
5
6class A {
7    public function method() {
8        var_dump($this);
9    }
10}
11
12class B {
13}
14
15$fn = Closure::fromCallable([new A, 'method']);
16$fn->call(new B);
17
18?>
19--EXPECTF--
20Warning: Cannot bind method A::method() to object of class B in %s on line %d
Note: See TracBrowser for help on using the repository browser.