PHP Undefined variable error
<p>I have this class ( it is simple card class):</p>

<pre><code>    class Card{
private $suit;
private $rank;

public function __construct($suit, $rank){
    $this-&gt;$suit = $suit;
    $this-&gt;$rank = $rank;
}

public function get_suit(){
    return $this-&gt;$suit;
}

public function get_rank(){
    return $this-&gt;$rank;
}
    }
</code></pre>

<p>I instance every card ( with suit and rank) for deck :</p>

<pre><code>        $tmp_deck = array();
    foreach ($SUITS as $suit){
        foreach($RANKS as $rank){
            array_push( $tmp_deck, new Card($suit, $rank) );
        }
    }
    echo $tmp_deck[0]-&gt;get_suit();
</code></pre>

<p>And error it gives me :</p>

<pre><code>Notice: Undefined variable: suit in card.php on line 13
</code></pre>

<p>I really cant get what is wrong. Can any one help me ?</p>
