//zhan $stack = new SplStack(); $stack->push(‘data1‘); $stack->push(‘data2‘); echo $stack->pop(); echo $stack->pop();
//queue $queue = new SplQueue(); $queue->enqueue(‘data1‘); $queue->enqueue(‘data2‘); echo $queue->dequeue(); echo $queue->dequeue();
//zuixiaodui $heap = new SplMinHeap(); $heap->insert(‘data1‘); $heap->insert(‘data2‘); echo $heap->extract(); echo $heap->extract();
//固定长度的数组 $array = new SplFixedArray(10); $array[0] = ‘123‘; $array[1] = ‘1223‘; var_dump($array);
原文:http://www.cnblogs.com/alihenaixiao/p/6012041.html