3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [0 => '3',1 => '2',2 => '1',3 => '0']; $rev = array_reverse($arr); // print_r($arr); $i = 0; $list = []; while ($i < count($arr)) { $list[] = $rev[$i]; $i++; } print_r($list); $i = 0; $list = []; while ($i < count($arr)) { $list[$arr[$i]] = $rev[$i]; $i++; } print_r($list);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 8
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 21
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 21
Branch analysis from position: 29
Branch analysis from position: 21
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 8
Branch analysis from position: 15
Branch analysis from position: 8
filename:       /in/8HjFB
function name:  (null)
number of ops:  33
compiled vars:  !0 = $arr, !1 = $rev, !2 = $i, !3 = $list
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        INIT_FCALL                                               'array_reverse'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $5      
          4        ASSIGN                                                   !1, $5
    6     5        ASSIGN                                                   !2, 0
    7     6        ASSIGN                                                   !3, <array>
    8     7      > JMP                                                      ->12
    9     8    >   FETCH_DIM_R                                      ~10     !1, !2
          9        ASSIGN_DIM                                               !3
         10        OP_DATA                                                  ~10
   10    11        PRE_INC                                                  !2
    8    12    >   COUNT                                            ~12     !0
         13        IS_SMALLER                                               !2, ~12
         14      > JMPNZ                                                    ~13, ->8
   12    15    >   INIT_FCALL                                               'print_r'
         16        SEND_VAR                                                 !3
         17        DO_ICALL                                                 
   14    18        ASSIGN                                                   !2, 0
   15    19        ASSIGN                                                   !3, <array>
   16    20      > JMP                                                      ->26
   17    21    >   FETCH_DIM_R                                      ~17     !0, !2
         22        FETCH_DIM_R                                      ~19     !1, !2
         23        ASSIGN_DIM                                               !3, ~17
         24        OP_DATA                                                  ~19
   18    25        PRE_INC                                                  !2
   16    26    >   COUNT                                            ~21     !0
         27        IS_SMALLER                                               !2, ~21
         28      > JMPNZ                                                    ~22, ->21
   20    29    >   INIT_FCALL                                               'print_r'
         30        SEND_VAR                                                 !3
         31        DO_ICALL                                                 
         32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.96 ms | 1012 KiB | 15 Q