1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Hi, I have a problem with array

Discussion in 'Development' started by TheKevnSG, Aug 7, 2019.

  1. TheKevnSG

    TheKevnSG Silverfish

    Messages:
    18
    GitHub:
    thekevinsg
    Fatal error: Nesting level too deep - recursive dependency line 132

    Codigo:
    public function inGame(Player $player) {
    return in_array($player, $this->getPlayers());
    }
     
  2. Deniel

    Deniel Spider Jockey

    Messages:
    42
    GitHub:
    DenielWorld
    Make sure that $this->getPlayers() returns an array. I suggest using PHPStorm, it may help you a lot when coding. Just make sure to have PMMP API installed in it.
     
  3. TheKevnSG

    TheKevnSG Silverfish

    Messages:
    18
    GitHub:
    thekevinsg
    But how will I know that if I don't know why I get the error

    That error causes my server to close when a player enters the game
     
  4. Deniel

    Deniel Spider Jockey

    Messages:
    42
    GitHub:
    DenielWorld
    Use PHPStorm, It'll help you fix all problems.
     
  5. wolfdale

    wolfdale Zombie Pigman

    Messages:
    535
    GitHub:
    diamond-gold
    Show us full code, we cant help with bits and pieces of info
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.