]> granicus.if.org Git - php/blob
8c7461e4f7
[php] /
1 --TEST--
2 Incompatible context call (non-internal function)
3 --FILE--
4 <?php
5
6 class A {
7     function foo() { var_dump(get_class($this)); }
8 }
9 class B {
10     function bar() { A::foo(); }
11 }
12 $b = new B;
13 try {
14     $b->bar();
15 } catch (Throwable $e) {
16     echo "Exception: " . $e->getMessage() . "\n";
17 }
18 ?>
19 --EXPECTF--
20 Exception: Non-static method A::foo() cannot be called statically