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]; echo " "; $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/0k0BH
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>
   15     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 = 25
Branch analysis from position: 25
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 3
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 3
Branch analysis from position: 29
Branch analysis from position: 3
filename:       /in/0k0BH
function name:  array_rev
number of ops:  30
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                                                      ->25
    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        ECHO                                                     '+'
   10    14        COUNT                                            ~12     !0
         15        ADD                                              ~13     !1, 1
         16        SUB                                              ~14     ~12, ~13
         17        ASSIGN_DIM                                               !0, ~14
         18        OP_DATA                                                  !2
   11    19        COUNT                                            ~16     !0
         20        ADD                                              ~17     !1, 1
         21        SUB                                              ~18     ~16, ~17
         22        FETCH_DIM_R                                      ~19     !0, ~18
         23        ECHO                                                     ~19
    5    24        PRE_INC                                                  !1
         25    >   COUNT                                            ~21     !0
         26        DIV                                              ~22     ~21, 2
         27        IS_SMALLER_OR_EQUAL                                      !1, ~22
         28      > JMPNZ                                                    ~23, ->3
   13    29    > > RETURN                                                   null

End of function array_rev

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
181.34 ms | 1399 KiB | 14 Q