标签:
//栈结构,先进后出 $stack = new SplStack(); //入 $stack->push("data1<br>"); $stack->push("data2<br>"); echo $stack->pop(); echo $stack->pop(); //队列,先进先出 $queue = new SplQueue(); //入 $queue->enqueue(‘data1<br>‘); $queue->enqueue(‘data2<br>‘); echo $queue->dequeue(); echo $queue->dequeue(); //堆结构,先进先出 $heap = new SplMinHeap(); //入 $heap->insert(‘data1<br>‘); $heap->insert(‘data2<br>‘); echo $heap->extract(); echo $heap->extract(); //固定尺寸数组 $array = new SplFixedArray(10); $array[0] = 1; $array[9] = 10; var_dump($array);
php官网地址:http://php.net/spl
标签:
原文地址:http://www.cnblogs.com/lxdd/p/4832922.html