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(); //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()); $pq->next(); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 36
Branch analysis from position: 36
2 jumps found. (Code = 44) Position 1 = 39, Position 2 = 29
Branch analysis from position: 39
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 39, Position 2 = 29
Branch analysis from position: 39
Branch analysis from position: 29
filename:       /in/85Xk4
function name:  (null)
number of ops:  40
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        ECHO                                                     ~9
   15    23        INIT_METHOD_CALL                                         !0, 'setExtractFlags'
         24        SEND_VAL_EX                                              3
         25        DO_FCALL                                      0          
   18    26        INIT_METHOD_CALL                                         !0, 'top'
         27        DO_FCALL                                      0          
   21    28      > JMP                                                      ->36
   22    29    >   INIT_FCALL                                               'print_r'
         30        INIT_METHOD_CALL                                         !0, 'current'
         31        DO_FCALL                                      0  $12     
         32        SEND_VAR                                                 $12
         33        DO_ICALL                                                 
   23    34        INIT_METHOD_CALL                                         !0, 'next'
         35        DO_FCALL                                      0          
   21    36    >   INIT_METHOD_CALL                                         !0, 'valid'
         37        DO_FCALL                                      0  $15     
         38      > JMPNZ                                                    $15, ->29
   24    39    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.1 ms | 1400 KiB | 15 Q