[ public | private | protected ] プロパティ名 [= 初期値];
<?php class TestClass { public $data1 = "abc"; private $data2 = "abc"; public function getData() { return $this->data2; } }
$obj = new TestClass(); print "関数実行:" . $obj->getData() . "\n"; print "プロパティ表示:" . $obj->data . "\n"; ?>