3v4l.org

run code in 300+ PHP versions simultaneously
<?php $pq = new SplPriorityQueue(); //insert method inserts an element in the queue by shifting it up $pq->insert('A', 3); $pq->insert('B', 6); $pq->insert('C', -1); $pq->insert('D', 2); //count the elements echo "count ->" . $pq->count() . "<br />"; //Sets the mode of extraction (EXTR_DATA, EXTR_PRIORITY, EXTR_BOTH) $pq->setExtractFlags(SplPriorityQueue::EXTR_BOTH); //go at the node from the top of the queue $pq->top(); //iterate the queue (by priority) and display each element while ($pq->valid()) { print_r($pq->current()); echo "<br />"; $pq->next(); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
2 jumps found. (Code = 44) Position 1 = 41, Position 2 = 30
Branch analysis from position: 41
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 30
2 jumps found. (Code = 44) Position 1 = 41, Position 2 = 30
Branch analysis from position: 41
Branch analysis from position: 30
filename:       /in/tR1eb
function name:  (null)
number of ops:  42
compiled vars:  !0 = $pq
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $1      'SplPriorityQueue'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
    6     3        INIT_METHOD_CALL                                         !0, 'insert'
          4        SEND_VAL_EX                                              'A'
          5        SEND_VAL_EX                                              3
          6        DO_FCALL                                      0          
    7     7        INIT_METHOD_CALL                                         !0, 'insert'
          8        SEND_VAL_EX                                              'B'
          9        SEND_VAL_EX                                              6
         10        DO_FCALL                                      0          
    8    11        INIT_METHOD_CALL                                         !0, 'insert'
         12        SEND_VAL_EX                                              'C'
         13        SEND_VAL_EX                                              -1
         14        DO_FCALL                                      0          
    9    15        INIT_METHOD_CALL                                         !0, 'insert'
         16        SEND_VAL_EX                                              'D'
         17        SEND_VAL_EX                                              2
         18        DO_FCALL                                      0          
   12    19        INIT_METHOD_CALL                                         !0, 'count'
         20        DO_FCALL                                      0  $8      
         21        CONCAT                                           ~9      'count+-%3E', $8
         22        CONCAT                                           ~10     ~9, '%3Cbr+%2F%3E'
         23        ECHO                                                     ~10
   15    24        INIT_METHOD_CALL                                         !0, 'setExtractFlags'
         25        SEND_VAL_EX                                              3
         26        DO_FCALL                                      0          
   18    27        INIT_METHOD_CALL                                         !0, 'top'
         28        DO_FCALL                                      0          
   21    29      > JMP                                                      ->38
   22    30    >   INIT_FCALL                                               'print_r'
         31        INIT_METHOD_CALL                                         !0, 'current'
         32        DO_FCALL                                      0  $13     
         33        SEND_VAR                                                 $13
         34        DO_ICALL                                                 
   23    35        ECHO                                                     '%3Cbr+%2F%3E'
   24    36        INIT_METHOD_CALL                                         !0, 'next'
         37        DO_FCALL                                      0          
   21    38    >   INIT_METHOD_CALL                                         !0, 'valid'
         39        DO_FCALL                                      0  $16     
         40      > JMPNZ                                                    $16, ->30
   25    41    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.57 ms | 1400 KiB | 15 Q