<?php
header('Content-type:text/html;charset=utf-8');
class Staff
#{
private $name ;
// public $age ;
//public $salary;
公共函數 __construct($name,$age,$salary)
{
$this->age = $age; $this->salary =$salary
{
return $this->name;
# }
if($name === 'age') { $this- >name=$ value; }}# $obj=new Staff('22',24,500); //echo $ obj->姓名; echo $obj->age;# echo '
## echo $obj->salary;
類別裡面的私有成員沒有數量限制