3v4l.org

run code in 300+ PHP versions simultaneously
<?php function swapOutermost(&$a, $i = 0) { $last = count($a) - 1 - $i; if ($i < $last) { [$a[$i], $a[$last]] = [$a[$last], $a[$i]]; swapOutermost($a, ++$i); } } $array = [1, 2, 3, 4, 5, 6, 7]; swapOutermost($array); var_export($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LLmZB
function name:  (null)
number of ops:  8
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   ASSIGN                                                   !0, <array>
   12     1        INIT_FCALL                                               'swapoutermost'
          2        SEND_REF                                                 !0
          3        DO_FCALL                                      0          
   13     4        INIT_FCALL                                               'var_export'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function swapoutermost:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 24
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/LLmZB
function name:  swapOutermost
number of ops:  25
compiled vars:  !0 = $a, !1 = $i, !2 = $last
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      0
    4     2        COUNT                                            ~3      !0
          3        SUB                                              ~4      ~3, 1
          4        SUB                                              ~5      ~4, !1
          5        ASSIGN                                                   !2, ~5
    5     6        IS_SMALLER                                               !1, !2
          7      > JMPZ                                                     ~7, ->24
    6     8    >   FETCH_DIM_R                                      ~8      !0, !2
          9        INIT_ARRAY                                       ~9      ~8
         10        FETCH_DIM_R                                      ~10     !0, !1
         11        ADD_ARRAY_ELEMENT                                ~9      ~10
         12        FETCH_LIST_R                                     $11     ~9, 0
         13        ASSIGN_DIM                                               !0, !1
         14        OP_DATA                                                  $11
         15        FETCH_LIST_R                                     $13     ~9, 1
         16        ASSIGN_DIM                                               !0, !2
         17        OP_DATA                                                  $13
         18        FREE                                                     ~9
    7    19        INIT_FCALL_BY_NAME                                       'swapOutermost'
         20        SEND_VAR_EX                                              !0
         21        PRE_INC                                          ~15     !1
         22        SEND_VAL_EX                                              ~15
         23        DO_FCALL                                      0          
    9    24    > > RETURN                                                   null

End of function swapoutermost

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.76 ms | 1001 KiB | 15 Q