xref: /PHP-8.1/Zend/tests/incompat_ctx_user.phpt (revision 5dafd7b4)
1--TEST--
2Incompatible context call (non-internal function)
3--FILE--
4<?php
5
6class A {
7    function foo() { var_dump(get_class($this)); }
8}
9class B {
10    function bar() { A::foo(); }
11}
12$b = new B;
13try {
14    $b->bar();
15} catch (Throwable $e) {
16    echo "Exception: " . $e->getMessage() . "\n";
17}
18?>
19--EXPECT--
20Exception: Non-static method A::foo() cannot be called statically
21