3v4l.org

run code in 300+ PHP versions simultaneously
<?php function reverse3($arr) { $len = count($arr); for ($i = 0; $i < ceil($len/2) - 1; ++$i) { echo $i . "!"; $place = $len - 1 - $i; $tmp = $arr[$place]; $arr[$place] = $arr[$i]; $arr[$i] = $tmp; } return $arr; } var_dump(reverse3(array(1,2,3,4)));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Y32hW
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'reverse3'
          2        SEND_VAL                                                 <array>
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

Function reverse3:
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 = 25, Position 2 = 5
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 5
Branch analysis from position: 25
Branch analysis from position: 5
filename:       /in/Y32hW
function name:  reverse3
number of ops:  27
compiled vars:  !0 = $arr, !1 = $len, !2 = $i, !3 = $place, !4 = $tmp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        COUNT                                            ~5      !0
          2        ASSIGN                                                   !1, ~5
    5     3        ASSIGN                                                   !2, 0
          4      > JMP                                                      ->18
    6     5    >   CONCAT                                           ~8      !2, '%21'
          6        ECHO                                                     ~8
    7     7        SUB                                              ~9      !1, 1
          8        SUB                                              ~10     ~9, !2
          9        ASSIGN                                                   !3, ~10
    8    10        FETCH_DIM_R                                      ~12     !0, !3
         11        ASSIGN                                                   !4, ~12
    9    12        FETCH_DIM_R                                      ~15     !0, !2
         13        ASSIGN_DIM                                               !0, !3
         14        OP_DATA                                                  ~15
   10    15        ASSIGN_DIM                                               !0, !2
         16        OP_DATA                                                  !4
    5    17        PRE_INC                                                  !2
         18    >   INIT_FCALL                                               'ceil'
         19        DIV                                              ~18     !1, 2
         20        SEND_VAL                                                 ~18
         21        DO_ICALL                                         $19     
         22        SUB                                              ~20     $19, 1
         23        IS_SMALLER                                               !2, ~20
         24      > JMPNZ                                                    ~21, ->5
   12    25    > > RETURN                                                   !0
   13    26*     > RETURN                                                   null

End of function reverse3

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
179.2 ms | 1399 KiB | 18 Q