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();
?>