3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = ['First', 'Second', 'Third', 'Fourth', 'Fifth', 'Sixth']; shuffle($data); $result = [$data[0], $data[count($data)-1]]; 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 = 21
Branch analysis from position: 21
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 13
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 13
Branch analysis from position: 25
Branch analysis from position: 13
filename:       /in/es2Vi
function name:  (null)
number of ops:  29
compiled vars:  !0 = $data, !1 = $result, !2 = $i
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                                      ~5      !0, 0
          5        INIT_ARRAY                                       ~6      ~5
          6        COUNT                                            ~7      !0
          7        SUB                                              ~8      ~7, 1
          8        FETCH_DIM_R                                      ~9      !0, ~8
          9        ADD_ARRAY_ELEMENT                                ~6      ~9
         10        ASSIGN                                                   !1, ~6
    6    11        ASSIGN                                                   !2, 0
         12      > JMP                                                      ->21
    8    13    >   FETCH_DIM_R                                      ~13     !0, !2
         14        INIT_ARRAY                                       ~14     ~13
         15        ADD                                              ~15     !2, 1
         16        FETCH_DIM_R                                      ~16     !0, ~15
         17        ADD_ARRAY_ELEMENT                                ~14     ~16
         18        ASSIGN_DIM                                               !1
         19        OP_DATA                                                  ~14
    6    20        PRE_INC                                                  !2
         21    >   COUNT                                            ~18     !0
         22        SUB                                              ~19     ~18, 1
         23        IS_SMALLER                                               !2, ~19
         24      > JMPNZ                                                    ~20, ->13
   10    25    >   INIT_FCALL                                               'var_dump'
         26        SEND_VAR                                                 !1
         27        DO_ICALL                                                 
         28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.44 ms | 1396 KiB | 17 Q