3v4l.org

run code in 300+ PHP versions simultaneously
<?php $items[] = array("apple", "green", 5.13); $items[] = array("banana", "green", 5.03); $items[] = array("banana", "yellow", 6.13); $items[] = array("apple", "red", 7.13); function sortByOrder($a, $b) { return ($a[2] > $b[2]) ? +1 : -1; } usort($items, 'sortByOrder'); foreach ($items as $item) { echo "$item[2] : $item[0] - $item[1]\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 25
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 25
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/23BVD
function name:  (null)
number of ops:  27
compiled vars:  !0 = $items, !1 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN_DIM                                               !0
          1        OP_DATA                                                  <array>
    4     2        ASSIGN_DIM                                               !0
          3        OP_DATA                                                  <array>
    5     4        ASSIGN_DIM                                               !0
          5        OP_DATA                                                  <array>
    6     6        ASSIGN_DIM                                               !0
          7        OP_DATA                                                  <array>
   12     8        INIT_FCALL                                               'usort'
          9        SEND_REF                                                 !0
         10        SEND_VAL                                                 'sortByOrder'
         11        DO_ICALL                                                 
   14    12      > FE_RESET_R                                       $7      !0, ->25
         13    > > FE_FETCH_R                                               $7, !1, ->25
   15    14    >   FETCH_DIM_R                                      ~8      !1, 2
         15        ROPE_INIT                                     6  ~12     ~8
         16        ROPE_ADD                                      1  ~12     ~12, '+%3A+'
         17        FETCH_DIM_R                                      ~9      !1, 0
         18        ROPE_ADD                                      2  ~12     ~12, ~9
         19        ROPE_ADD                                      3  ~12     ~12, '+-+'
         20        FETCH_DIM_R                                      ~10     !1, 1
         21        ROPE_ADD                                      4  ~12     ~12, ~10
         22        ROPE_END                                      5  ~11     ~12, '%0A'
         23        ECHO                                                     ~11
   14    24      > JMP                                                      ->13
         25    >   FE_FREE                                                  $7
   16    26      > RETURN                                                   1

Function sortbyorder:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/23BVD
function name:  sortByOrder
number of ops:  11
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    9     2        FETCH_DIM_R                                      ~2      !0, 2
          3        FETCH_DIM_R                                      ~3      !1, 2
          4        IS_SMALLER                                               ~3, ~2
          5      > JMPZ                                                     ~4, ->8
          6    >   QM_ASSIGN                                        ~5      1
          7      > JMP                                                      ->9
          8    >   QM_ASSIGN                                        ~5      -1
          9    > > RETURN                                                   ~5
   10    10*     > RETURN                                                   null

End of function sortbyorder

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.41 ms | 1400 KiB | 15 Q