php-src/Zend/tests/incompat_ctx_user.phpt
2019-01-30 09:19:02 +01:00

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