3v4l.org

run code in 300+ PHP versions simultaneously
<?php class FifaRankingHeap extends \SplHeap { protected function compare($value1, $value2) { return $value1['points'] - $value2['points']; }} $heap = new FifaRankingHeap(); $heap->insert(array('country' => 'Colombia', 'points' => 1137)); $heap->insert(array('country' => 'Uruguay', 'points' => 1147)); $heap->insert(array('country' => 'Argentina', 'points' => 1175)); $heap->insert(array('country' => 'Brazil', 'points' => 1242)); $heap->insert(array('country' => 'Portugal', 'points' => 1189)); $heap->insert(array('country' => 'Germany', 'points' => 1300)); $heap->insert(array('country' => 'Switzerland', 'points' => 1149)); $i = 2; foreach ($heap as $country) { echo $i++.$country['country'].' has '.$country['points'].' points.'; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 26, Position 2 = 36
Branch analysis from position: 26
2 jumps found. (Code = 78) Position 1 = 27, Position 2 = 36
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
Branch analysis from position: 36
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 36
filename:       /in/vckTV
function name:  (null)
number of ops:  38
compiled vars:  !0 = $heap, !1 = $i, !2 = $country
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   NEW                                              $3      'FifaRankingHeap'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
    8     3        INIT_METHOD_CALL                                         !0, 'insert'
          4        SEND_VAL_EX                                              <array>
          5        DO_FCALL                                      0          
    9     6        INIT_METHOD_CALL                                         !0, 'insert'
          7        SEND_VAL_EX                                              <array>
          8        DO_FCALL                                      0          
   10     9        INIT_METHOD_CALL                                         !0, 'insert'
         10        SEND_VAL_EX                                              <array>
         11        DO_FCALL                                      0          
   11    12        INIT_METHOD_CALL                                         !0, 'insert'
         13        SEND_VAL_EX                                              <array>
         14        DO_FCALL                                      0          
   12    15        INIT_METHOD_CALL                                         !0, 'insert'
         16        SEND_VAL_EX                                              <array>
         17        DO_FCALL                                      0          
   13    18        INIT_METHOD_CALL                                         !0, 'insert'
         19        SEND_VAL_EX                                              <array>
         20        DO_FCALL                                      0          
   14    21        INIT_METHOD_CALL                                         !0, 'insert'
         22        SEND_VAL_EX                                              <array>
         23        DO_FCALL                                      0          
   15    24        ASSIGN                                                   !1, 2
   16    25      > FE_RESET_R                                       $14     !0, ->36
         26    > > FE_FETCH_R                                               $14, !2, ->36
   17    27    >   POST_INC                                         ~15     !1
         28        FETCH_DIM_R                                      ~16     !2, 'country'
         29        CONCAT                                           ~17     ~15, ~16
         30        CONCAT                                           ~18     ~17, '+has+'
         31        FETCH_DIM_R                                      ~19     !2, 'points'
         32        CONCAT                                           ~20     ~18, ~19
         33        CONCAT                                           ~21     ~20, '+points.'
         34        ECHO                                                     ~21
   16    35      > JMP                                                      ->26
         36    >   FE_FREE                                                  $14
   18    37      > RETURN                                                   1

Class FifaRankingHeap:
Function compare:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vckTV
function name:  compare
number of ops:  7
compiled vars:  !0 = $value1, !1 = $value2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    5     2        FETCH_DIM_R                                      ~2      !0, 'points'
          3        FETCH_DIM_R                                      ~3      !1, 'points'
          4        SUB                                              ~4      ~2, ~3
          5      > RETURN                                                   ~4
    6     6*     > RETURN                                                   null

End of function compare

End of class FifaRankingHeap.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.45 ms | 1399 KiB | 13 Q