PHP面试题作业
class DuiLie { private $array = array();//声明空数组 public function setFirst($item){ return array_unshift($this->array,$item);//头入列 } public function delFirst(){ return array_shift($this->array);//头出列 } public function setLast($item){ return array_push($this->array,$item);//尾入列 } public function delLast(){ return array_pop($this->array,$item);//尾出列 } public function show(){ var_dump($this->array);//打印数组 } public function Del(){ unset($this->array);//清空数组 } }