summaryrefslogtreecommitdiff
path: root/Zend/tests/bug77877.phpt
blob: 6ed35213efb276544fccfb64eeb6986185487263 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
--TEST--
Bug #77877 call_user_func() passes $this to static methods
--FILE--
<?php
class Foo {
    static public function bar() {
        var_dump($this);
    }
}
try {
    array_map([new Foo, 'bar'],[1]);
} catch (Throwable $e) {
    echo $e->getMessage() . "\n";
}
try {
    call_user_func([new Foo, 'bar']);
} catch (Throwable $e) {
    echo $e->getMessage() . "\n";
}
?>
--EXPECT--
Using $this when not in object context
Using $this when not in object context