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

End of function array_rev

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.3 ms | 1398 KiB | 14 Q