3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = array(-3,5,1,3,2,10); function array_rev($array) { for ($i = 0; $i <= count($array)/2; $i++) { $holder = $array[$i]; $array[$i] = $array[count($array) - ($i + 1)]; echo $array[$i]; $array[count($array) - ($i + 1)] = $holder; echo $array[count($array) - ($i + 1)]; } } array_rev($x);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WJOC8
function name:  (null)
number of ops:  5
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   14     1        INIT_FCALL                                               'array_rev'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0          
          4      > RETURN                                                   1

Function array_rev:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 3
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 3
Branch analysis from position: 28
Branch analysis from position: 3
filename:       /in/WJOC8
function name:  array_rev
number of ops:  29
compiled vars:  !0 = $array, !1 = $i, !2 = $holder
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        ASSIGN                                                   !1, 0
          2      > JMP                                                      ->24
    6     3    >   FETCH_DIM_R                                      ~4      !0, !1
          4        ASSIGN                                                   !2, ~4
    7     5        COUNT                                            ~7      !0
          6        ADD                                              ~8      !1, 1
          7        SUB                                              ~9      ~7, ~8
          8        FETCH_DIM_R                                      ~10     !0, ~9
          9        ASSIGN_DIM                                               !0, !1
         10        OP_DATA                                                  ~10
    8    11        FETCH_DIM_R                                      ~11     !0, !1
         12        ECHO                                                     ~11
    9    13        COUNT                                            ~12     !0
         14        ADD                                              ~13     !1, 1
         15        SUB                                              ~14     ~12, ~13
         16        ASSIGN_DIM                                               !0, ~14
         17        OP_DATA                                                  !2
   10    18        COUNT                                            ~16     !0
         19        ADD                                              ~17     !1, 1
         20        SUB                                              ~18     ~16, ~17
         21        FETCH_DIM_R                                      ~19     !0, ~18
         22        ECHO                                                     ~19
    5    23        PRE_INC                                                  !1
         24    >   COUNT                                            ~21     !0
         25        DIV                                              ~22     ~21, 2
         26        IS_SMALLER_OR_EQUAL                                      !1, ~22
         27      > JMPNZ                                                    ~23, ->3
   12    28    > > RETURN                                                   null

End of function array_rev

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.44 ms | 1399 KiB | 14 Q