PHPで擬似変数$thisって、何のためにあるの?と思ったので調べてみました。 例:擬似変数$this <?php /* クラスCartを定義 */ class Cart { // 全てpublicなプロパティ var $todays_date; var $name; var $owner; var $items = array("VCR", "TV"); // publicなメソッド function Cart() { $this->todays_date = date("Y-m-d"); $this->name = $GLOBALS['firstname']; /* 等など. . . */ } } $cart = new Cart; // オブジェクト名(参照型変数)$cart $cart->add_item("10", 1); $another_cart = new Cart;