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/oodTq
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 = 20
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 24, Position 2 = 3
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 24, Position 2 = 3
Branch analysis from position: 24
Branch analysis from position: 3
filename:       /in/oodTq
function name:  array_rev
number of ops:  26
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                                                      ->20
    6     3    >   FETCH_DIM_R                                      ~4      !0, !1
          4        ASSIGN                                                   !2, ~4
    7     5        FETCH_CONSTANT                                   ~6      'i'
          6        COUNT                                            ~8      !0
          7        FETCH_CONSTANT                                   ~9      'i'
          8        ADD                                              ~10     ~9, 1
          9        SUB                                              ~11     ~8, ~10
         10        FETCH_DIM_R                                      ~12     !0, ~11
         11        ASSIGN_DIM                                               !0, ~6
         12        OP_DATA                                                  ~12
    8    13        COUNT                                            ~13     !0
         14        FETCH_CONSTANT                                   ~14     'i'
         15        ADD                                              ~15     ~14, 1
         16        SUB                                              ~16     ~13, ~15
         17        ASSIGN_DIM                                               !0, ~16
         18        OP_DATA                                                  !2
    5    19        PRE_INC                                                  !1
         20    >   COUNT                                            ~19     !0
         21        DIV                                              ~20     ~19, 2
         22        IS_EQUAL                                                 !1, ~20
         23      > JMPNZ                                                    ~21, ->3
   10    24    >   ECHO                                                     !0
   11    25      > RETURN                                                   null

End of function array_rev

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.01 ms | 1399 KiB | 14 Q