wrong_inlining_002.phpt 677 B

1234567891011121314151617181920212223242526272829
  1. --TEST--
  2. $this not in object context
  3. --INI--
  4. opcache.enable=1
  5. opcache.enable_cli=1
  6. opcache.optimization_level=-1
  7. --SKIPIF--
  8. <?php require_once('skipif.inc'); ?>
  9. --FILE--
  10. <?php
  11. class Foo {
  12. private function getConst() {
  13. return 42;
  14. }
  15. public function test() {
  16. var_dump($this->getConst());
  17. }
  18. }
  19. Foo::test();
  20. ?>
  21. --EXPECTF--
  22. Deprecated: Non-static method Foo::test() should not be called statically in %swrong_inlining_002.php on line 11
  23. Fatal error: Uncaught Error: Using $this when not in object context in %swrong_inlining_002.php:7
  24. Stack trace:
  25. #0 %swrong_inlining_002.php(11): Foo::test()
  26. #1 {main}
  27. thrown in %swrong_inlining_002.php on line 7