summaryrefslogtreecommitdiff
path: root/Zend/tests/call_user_func_closure_from_static_method.phpt
blob: b427b85527db402343cc4d55e50bb81321c0fe24 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
--TEST--
call_user_func() on non-static closure without $this inside a static method
--FILE--
<?php

class A {
    public static function exec(callable $c) {
        return call_user_func($c);
    }

    public static function doSomething() {
        return self::exec(function(){
            return "okay";
        });
    }
}

var_dump(A::doSomething());

?>
--EXPECT--
string(4) "okay"