summaryrefslogtreecommitdiff
path: root/ext/standard/tests/general_functions/is_callable_anon.phpt
blob: 635f2a04ab29ceb6ab4d8e8fff702bfb04ea5bf7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
--TEST--
Test is_callable() function : usage variations - anonymous class method
--FILE--
<?php

new class {
    function __construct() {
        $fname = null;
        if (is_callable([$this, 'f'], false, $fname)) {
            call_user_func($fname);
        } else {
            echo "dang\n";
        }
    }
    function f() {
        echo "nice\n";
    }
};

?>
--EXPECT--
nice