xref: /PHP-7.3/Zend/tests/incompat_ctx_user.phpt (revision a9512af8)
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--EXPECTF--
20Deprecated: Non-static method A::foo() should not be called statically in %s on line %d
21Exception: Using $this when not in object context
22