mirror of
https://github.com/php/php-src.git
synced 2024-09-23 19:07:26 +00:00
21 lines
374 B
PHP
21 lines
374 B
PHP
--TEST--
|
|
Incompatible context call (non-internal function)
|
|
--FILE--
|
|
<?php
|
|
|
|
class A {
|
|
function foo() { var_dump(get_class($this)); }
|
|
}
|
|
class B {
|
|
function bar() { A::foo(); }
|
|
}
|
|
$b = new B;
|
|
try {
|
|
$b->bar();
|
|
} catch (Throwable $e) {
|
|
echo "Exception: " . $e->getMessage() . "\n";
|
|
}
|
|
?>
|
|
--EXPECTF--
|
|
Exception: Non-static method A::foo() cannot be called statically
|