从成员函数访问php私有数组

When I run this code, I get only "in constructor" being printed out.

Why am I not seeing the array being printed out?

Apache log shows no errors. PHP syntax checkers show no errors.

<?php
//---- User Class ----      
class User {
    private $list;

    function __construct() { 
        echo "in constructor";
        $this->$list = array(1, 2, 5);
        }

    function printAll() {
        print_r($this->$list);
    }

}   // end Class  

$foo = new User(); 
$foo->printAll();
?>

a $ to much, try this

When I run this code, I get only "in constructor" being printed out.

Why am I not seeing the array being printed out?

Apache log shows no errors. PHP syntax checkers show no errors.

class User {
    private $list;

    function __construct() { 
        echo "in constructor";
        $this->list = array(1, 2, 5);
        }

    function printAll() {
        print_r($this->list);
    }
}

Yes $this->varname is the proper syntax which we mix up some times.

 class Cname {
    var $name;

     function setName($nam)
     {
         $this -> name = $nam;
     }
  }