color = $color; } function what_color() { return $this->color; } } function print_vars($obj) { foreach (get_object_vars($obj) as $prop => $val) { echo "\t$prop = $val\n"; } } // instantiate one object $herbie = new Car("white"); // show herbie properties echo "\herbie: Properties\n"; print_vars($herbie); echo "
PHP 基础教程 - 简单教程(www.twle.cn)
";