incompat_ctx_user.phpt 397 B

1234567891011121314151617181920
  1. --TEST--
  2. Incompatible context call (non-internal function)
  3. --INI--
  4. error_reporting=E_ALL
  5. --FILE--
  6. <?php
  7. class A {
  8. function foo() { var_dump(get_class($this)); }
  9. }
  10. class B {
  11. function bar() { A::foo(); }
  12. }
  13. $b = new B;
  14. $b->bar();
  15. ?>
  16. --EXPECTF--
  17. Deprecated: Non-static method A::foo() should not be called statically, assuming $this from incompatible context in %s on line %d
  18. string(1) "B"