3v4l.org

run code in 300+ PHP versions simultaneously
<?php $sizes = array("L", "XXXL", "M", "S", "O"); function compare($a, $b) { $sizeincrement = array("XS", "S", "M", "L", "XL", "XXL", "XXXL"); return array_search($a, $sizeincrement) > array_search($b, $sizeincrement); } usort($sizes, "compare"); print_r($sizes);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DXVTV
function name:  (null)
number of ops:  9
compiled vars:  !0 = $sizes
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    9     1        INIT_FCALL                                               'usort'
          2        SEND_REF                                                 !0
          3        SEND_VAL                                                 'compare'
          4        DO_ICALL                                                 
   11     5        INIT_FCALL                                               'print_r'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Function compare:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DXVTV
function name:  compare
number of ops:  14
compiled vars:  !0 = $a, !1 = $b, !2 = $sizeincrement
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    5     2        ASSIGN                                                   !2, <array>
    6     3        INIT_FCALL                                               'array_search'
          4        SEND_VAR                                                 !0
          5        SEND_VAR                                                 !2
          6        DO_ICALL                                         $4      
          7        INIT_FCALL                                               'array_search'
          8        SEND_VAR                                                 !1
          9        SEND_VAR                                                 !2
         10        DO_ICALL                                         $5      
         11        IS_SMALLER                                       ~6      $5, $4
         12      > RETURN                                                   ~6
    7    13*     > RETURN                                                   null

End of function compare

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.44 ms | 1387 KiB | 19 Q