3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = array(-3,5,1,3,2,10); function array_rev($array) { $half_count = count($array) / 2; for ($i = 0; $i <= $half_count; $i++) { $holder = $array[$i]; $array[$i] = $array[(count($array) - ($i + 1))]; $array[count($array) - ($i + 1)] = $holder; } return $array; } echo array_rev($x);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KF7M3
function name:  (null)
number of ops:  6
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  $2      
          4        ECHO                                                     $2
          5      > 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 = 22, Position 2 = 6
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 6
Branch analysis from position: 22
Branch analysis from position: 6
filename:       /in/KF7M3
function name:  array_rev
number of ops:  24
compiled vars:  !0 = $array, !1 = $half_count, !2 = $i, !3 = $holder
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        COUNT                                            ~4      !0
          2        DIV                                              ~5      ~4, 2
          3        ASSIGN                                                   !1, ~5
    6     4        ASSIGN                                                   !2, 0
          5      > JMP                                                      ->20
    7     6    >   FETCH_DIM_R                                      ~8      !0, !2
          7        ASSIGN                                                   !3, ~8
    8     8        COUNT                                            ~11     !0
          9        ADD                                              ~12     !2, 1
         10        SUB                                              ~13     ~11, ~12
         11        FETCH_DIM_R                                      ~14     !0, ~13
         12        ASSIGN_DIM                                               !0, !2
         13        OP_DATA                                                  ~14
    9    14        COUNT                                            ~15     !0
         15        ADD                                              ~16     !2, 1
         16        SUB                                              ~17     ~15, ~16
         17        ASSIGN_DIM                                               !0, ~17
         18        OP_DATA                                                  !3
    6    19        PRE_INC                                                  !2
         20    >   IS_SMALLER_OR_EQUAL                                      !2, !1
         21      > JMPNZ                                                    ~20, ->6
   11    22    > > RETURN                                                   !0
   12    23*     > RETURN                                                   null

End of function array_rev

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.17 ms | 1399 KiB | 14 Q