stack data Structure
1 $stack=NewSplstack ();//stack data Structure-advanced back-out2$stack->push (' data1 ');//into the stack3 $stack->push (' data2 ');//into the stack4 Echo $stack->pop ();//out of Stack->data25 Echo $stack->pop ();//out of Stack->data1
Queue data Structure
1 $queue=NewSplqueue ();//FIFO, queue data structure2 $queue->enqueue (' data1 ');//into Row3 $queue->enqueue (' data2 ');//into Row4 Echo $queue->dequeue ();//dequeue->data15 Echo $queue->dequeue ();//dequeue->data2
Heap Data Structures
1 $heap=NewSplminheap ();//Heap Data Structures2 $heap->insert (' data1 ');//Store3 $heap->insert (' data2 ');//Store4 Echo $heap-Extract();//Remove->data15 Echo $heap-Extract();//Remove->data2
Fixed-length array data structure
1 $array=NewSplfixedarray (10);//fixed-length array data structure with a declaration length of ten2 $array[0] = 0;3 $array[9] = 9;4 Var_dump($array); 5 //object (Splfixedarray) #1 (Ten) {[0]=> int (0) [1]=> null [2]=> null [3]=> null [4]=> null [5]=> NULL [ 6]=> null [7]=> null [8]=> null [9]=> INT (9)}6 //Subscript 1-8 allocates memory space, whether or not used
Common data structures for SPL standard libraries