3v4l.org

run code in 300+ PHP versions simultaneously
<?php $sizes = array("BAR", "L", "XXXL", "INVALID", "M", "S", "FOO"); function compare($a, $b) { list($a, $b) = array_keys(array("XS", "S", "M", "L", "XL", "XXL", "XXXL"), array($a, $b)); if($a == FALSE || $b == FALSE) return $a < $b; return $a > $b; } usort($sizes, "compare"); print_r($sizes);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NLsaF
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>
   10     1        INIT_FCALL                                               'usort'
          2        SEND_REF                                                 !0
          3        SEND_VAL                                                 'compare'
          4        DO_ICALL                                                 
   12     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
2 jumps found. (Code = 47) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 20
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/NLsaF
function name:  compare
number of ops:  23
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    5     2        INIT_FCALL                                               'array_keys'
          3        SEND_VAL                                                 <array>
          4        INIT_ARRAY                                       ~2      !0
          5        ADD_ARRAY_ELEMENT                                ~2      !1
          6        SEND_VAL                                                 ~2
          7        DO_ICALL                                         $3      
          8        FETCH_LIST_R                                     $4      $3, 0
          9        ASSIGN                                                   !0, $4
         10        FETCH_LIST_R                                     $6      $3, 1
         11        ASSIGN                                                   !1, $6
         12        FREE                                                     $3
    6    13        BOOL_NOT                                         ~8      !0
         14      > JMPNZ_EX                                         ~8      ~8, ->17
         15    >   BOOL_NOT                                         ~9      !1
         16        BOOL                                             ~8      ~9
         17    > > JMPZ                                                     ~8, ->20
         18    >   IS_SMALLER                                       ~10     !0, !1
         19      > RETURN                                                   ~10
    7    20    >   IS_SMALLER                                       ~11     !1, !0
         21      > RETURN                                                   ~11
    8    22*     > RETURN                                                   null

End of function compare

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.43 ms | 1396 KiB | 19 Q