summaryrefslogtreecommitdiff
path: root/Zend/tests/indirect_call_string_003.phpt
blob: 99289c4e1c23308bace5db6c86de4c77aa08d401 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
--TEST--
Dynamic static call to instance method should throw.
--CREDITS--
Aaron Piotrowski <aaron@icicle.io>
--FILE--
<?php
class TestClass
{
    private $test;

    public function method()
    {
        $this->test = 'test';
        return "Hello, world!\n";
    }
}

$callback = 'TestClass::method';
echo $callback();
?>
--EXPECTF--
Fatal error: Uncaught Error: Non-static method TestClass::method() cannot be called statically in %s:%d
Stack trace:
#0 {main}
  thrown in %s on line %d