3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = ['First', 'Second', 'Third', 'Fourth', 'Fifth', 'Sixth']; shuffle($data); $data[] = $data[0]; for($i=0; $i<count($data)-1; $i++) { $result[] = [$data[$i], $data[$i+1]]; } var_dump($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 9
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 9
Branch analysis from position: 21
Branch analysis from position: 9
filename:       /in/sq1XB
function name:  (null)
number of ops:  25
compiled vars:  !0 = $data, !1 = $i, !2 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        INIT_FCALL                                               'shuffle'
          2        SEND_REF                                                 !0
          3        DO_ICALL                                                 
    5     4        FETCH_DIM_R                                      ~6      !0, 0
          5        ASSIGN_DIM                                               !0
          6        OP_DATA                                                  ~6
    6     7        ASSIGN                                                   !1, 0
          8      > JMP                                                      ->17
    8     9    >   FETCH_DIM_R                                      ~9      !0, !1
         10        INIT_ARRAY                                       ~10     ~9
         11        ADD                                              ~11     !1, 1
         12        FETCH_DIM_R                                      ~12     !0, ~11
         13        ADD_ARRAY_ELEMENT                                ~10     ~12
         14        ASSIGN_DIM                                               !2
         15        OP_DATA                                                  ~10
    6    16        PRE_INC                                                  !1
         17    >   COUNT                                            ~14     !0
         18        SUB                                              ~15     ~14, 1
         19        IS_SMALLER                                               !1, ~15
         20      > JMPNZ                                                    ~16, ->9
   10    21    >   INIT_FCALL                                               'var_dump'
         22        SEND_VAR                                                 !2
         23        DO_ICALL                                                 
         24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.25 ms | 1395 KiB | 17 Q