method-with-this.php 545 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. class FirstClass
  3. {
  4. /**
  5. * @var int
  6. */
  7. private $firstProp = 9;
  8. public function funMethod()
  9. {
  10. function() {
  11. $this->firstProp;
  12. };
  13. call_user_func(function() {
  14. $this->funMethod();
  15. }, $this);
  16. $bind = 'bind';
  17. function() use($bind) {
  18. };
  19. }
  20. }
  21. function global_ok() {
  22. $_SERVER['REMOTE_ADDR'];
  23. }
  24. function global_this() {
  25. // not checked by our rule, it is checked with standard phpstan rule on level 0
  26. $this['REMOTE_ADDR'];
  27. }