3v4l.org

run code in 300+ PHP versions simultaneously
<?php $foo[1]['items'][] = 'Third'; $foo[0]['items'][] = 'Second'; $foo[4]['items'][] = 'Last'; $foo[-1]['items'][] = 'I will be first'; $foo[0]['items'][] = 'Also second'; function cmp($a, $b) { if ($a == $b) { return 0; } return ($a > $b) ? -1 : 1; } usort($foo, "cmp"); echo '<pre>'; var_dump($foo); echo '</pre>';
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KoJAl
function name:  (null)
number of ops:  30
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   FETCH_DIM_W                                      $1      !0, 1
          1        FETCH_DIM_W                                      $2      $1, 'items'
          2        ASSIGN_DIM                                               $2
          3        OP_DATA                                                  'Third'
    3     4        FETCH_DIM_W                                      $4      !0, 0
          5        FETCH_DIM_W                                      $5      $4, 'items'
          6        ASSIGN_DIM                                               $5
          7        OP_DATA                                                  'Second'
    4     8        FETCH_DIM_W                                      $7      !0, 4
          9        FETCH_DIM_W                                      $8      $7, 'items'
         10        ASSIGN_DIM                                               $8
         11        OP_DATA                                                  'Last'
    5    12        FETCH_DIM_W                                      $10     !0, -1
         13        FETCH_DIM_W                                      $11     $10, 'items'
         14        ASSIGN_DIM                                               $11
         15        OP_DATA                                                  'I+will+be+first'
    6    16        FETCH_DIM_W                                      $13     !0, 0
         17        FETCH_DIM_W                                      $14     $13, 'items'
         18        ASSIGN_DIM                                               $14
         19        OP_DATA                                                  'Also+second'
   16    20        INIT_FCALL                                               'usort'
         21        SEND_REF                                                 !0
         22        SEND_VAL                                                 'cmp'
         23        DO_ICALL                                                 
   17    24        ECHO                                                     '%3Cpre%3E'
   18    25        INIT_FCALL                                               'var_dump'
         26        SEND_VAR                                                 !0
         27        DO_ICALL                                                 
   19    28        ECHO                                                     '%3C%2Fpre%3E'
         29      > RETURN                                                   1

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

End of function cmp

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.79 ms | 1405 KiB | 17 Q