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)]; $array[count($array) - ($i + 1)] = $holder; } echo $array; } array_rev($x);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ELuAt
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>
   13     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 = 18
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 3
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 3
Branch analysis from position: 22
Branch analysis from position: 3
filename:       /in/ELuAt
function name:  array_rev
number of ops:  24
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                                                      ->18
    6     3    >   FETCH_DIM_R                                      ~4      !0, !1
          4        ASSIGN                                                   !2, ~4
    7     5        FETCH_CONSTANT                                   ~6      'i'
          6        COUNT                                            ~8      !0
          7        ADD                                              ~9      !1, 1
          8        SUB                                              ~10     ~8, ~9
          9        FETCH_DIM_R                                      ~11     !0, ~10
         10        ASSIGN_DIM                                               !0, ~6
         11        OP_DATA                                                  ~11
    8    12        COUNT                                            ~12     !0
         13        ADD                                              ~13     !1, 1
         14        SUB                                              ~14     ~12, ~13
         15        ASSIGN_DIM                                               !0, ~14
         16        OP_DATA                                                  !2
    5    17        PRE_INC                                                  !1
         18    >   COUNT                                            ~17     !0
         19        DIV                                              ~18     ~17, 2
         20        IS_SMALLER_OR_EQUAL                                      !1, ~18
         21      > JMPNZ                                                    ~19, ->3
   10    22    >   ECHO                                                     !0
   11    23      > RETURN                                                   null

End of function array_rev

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.61 ms | 1403 KiB | 14 Q