3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array("one" => 1, "two" => 2, "three" => 3, "four" => 4); print_r($array); $first = reset($array); $last = end($array); while (current($array) !== $first && key($array) !== null){ $array[key($array)] = prev($array); } $array[key($array)] = $last; print_r($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
2 jumps found. (Code = 46) Position 1 = 26, Position 2 = 31
Branch analysis from position: 26
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 13
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
2 jumps found. (Code = 46) Position 1 = 26, Position 2 = 31
Branch analysis from position: 26
Branch analysis from position: 31
Branch analysis from position: 31
filename:       /in/2gNCs
function name:  (null)
number of ops:  41
compiled vars:  !0 = $array, !1 = $first, !2 = $last
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        INIT_FCALL                                               'print_r'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
    7     4        INIT_FCALL                                               'reset'
          5        SEND_REF                                                 !0
          6        DO_ICALL                                         $5      
          7        ASSIGN                                                   !1, $5
    8     8        INIT_FCALL                                               'end'
          9        SEND_REF                                                 !0
         10        DO_ICALL                                         $7      
         11        ASSIGN                                                   !2, $7
   10    12      > JMP                                                      ->21
   11    13    >   INIT_FCALL                                               'key'
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                         $9      
         16        INIT_FCALL                                               'prev'
         17        SEND_REF                                                 !0
         18        DO_ICALL                                         $11     
         19        ASSIGN_DIM                                               !0, $9
         20        OP_DATA                                                  $11
   10    21    >   INIT_FCALL                                               'current'
         22        SEND_VAR                                                 !0
         23        DO_ICALL                                         $12     
         24        IS_NOT_IDENTICAL                                 ~13     !1, $12
         25      > JMPZ_EX                                          ~13     ~13, ->31
         26    >   INIT_FCALL                                               'key'
         27        SEND_VAR                                                 !0
         28        DO_ICALL                                         $14     
         29        TYPE_CHECK                                  1020  ~15     $14
         30        BOOL                                             ~13     ~15
         31    > > JMPNZ                                                    ~13, ->13
   14    32    >   INIT_FCALL                                               'key'
         33        SEND_VAR                                                 !0
         34        DO_ICALL                                         $16     
         35        ASSIGN_DIM                                               !0, $16
         36        OP_DATA                                                  !2
   16    37        INIT_FCALL                                               'print_r'
         38        SEND_VAR                                                 !0
         39        DO_ICALL                                                 
         40      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.02 ms | 1021 KiB | 19 Q