[ public | private | protected ] function メソッド名 ([引数1,引数2,...]) {...}
<?php class TestClass { private $data1 = "abc"; public function getData1() { return $this->getData2(); } private function getData2() { return $this->data1; } }
$obj = new TestClass(); print "関数実行:" . $obj->getData1() . "\n"; ?>