3v4l.org

run code in 300+ PHP versions simultaneously
<?php function cmp($a, $b) { return strcmp($a["fruit"], $b["fruit"]); } $fruits[0]["fruit"] = "lemons"; $fruits[1]["fruit"] = "apples"; $fruits[2]["fruit"] = "grapes"; usort($fruits, "cmp"); echo '<pre>'; print_r($fruits); echo '</pre>';
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/svPm2
function name:  (null)
number of ops:  19
compiled vars:  !0 = $fruits
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   FETCH_DIM_W                                      $1      !0, 0
          1        ASSIGN_DIM                                               $1, 'fruit'
          2        OP_DATA                                                  'lemons'
    8     3        FETCH_DIM_W                                      $3      !0, 1
          4        ASSIGN_DIM                                               $3, 'fruit'
          5        OP_DATA                                                  'apples'
    9     6        FETCH_DIM_W                                      $5      !0, 2
          7        ASSIGN_DIM                                               $5, 'fruit'
          8        OP_DATA                                                  'grapes'
   11     9        INIT_FCALL                                               'usort'
         10        SEND_REF                                                 !0
         11        SEND_VAL                                                 'cmp'
         12        DO_ICALL                                                 
   13    13        ECHO                                                     '%3Cpre%3E'
         14        INIT_FCALL                                               'print_r'
         15        SEND_VAR                                                 !0
         16        DO_ICALL                                                 
         17        ECHO                                                     '%3C%2Fpre%3E'
         18      > RETURN                                                   1

Function cmp:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/svPm2
function name:  cmp
number of ops:  10
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        INIT_FCALL                                               'strcmp'
          3        FETCH_DIM_R                                      ~2      !0, 'fruit'
          4        SEND_VAL                                                 ~2
          5        FETCH_DIM_R                                      ~3      !1, 'fruit'
          6        SEND_VAL                                                 ~3
          7        DO_ICALL                                         $4      
          8      > RETURN                                                   $4
    5     9*     > RETURN                                                   null

End of function cmp

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.43 ms | 1388 KiB | 19 Q