3v4l.org

run code in 300+ PHP versions simultaneously
<?php $t = range(1, 32, 1); $g = []; $i = 1; for($i = 1; $i<=8; $i++) { while (!empty($t) && count($g) < 4) { $key = array_rand($t); $g[$i][] = $t[$key]; unset($t[$key]); } } var_dump($g.$i); var_dump($t);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
2 jumps found. (Code = 44) Position 1 = 30, Position 2 = 10
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
2 jumps found. (Code = 46) Position 1 = 23, Position 2 = 26
Branch analysis from position: 23
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 11
Branch analysis from position: 27
2 jumps found. (Code = 44) Position 1 = 30, Position 2 = 10
Branch analysis from position: 30
Branch analysis from position: 10
Branch analysis from position: 11
2 jumps found. (Code = 46) Position 1 = 23, Position 2 = 26
Branch analysis from position: 23
Branch analysis from position: 26
Branch analysis from position: 26
filename:       /in/2vPrP
function name:  (null)
number of ops:  38
compiled vars:  !0 = $t, !1 = $g, !2 = $i, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'range'
          1        SEND_VAL                                                 1
          2        SEND_VAL                                                 32
          3        SEND_VAL                                                 1
          4        DO_ICALL                                         $4      
          5        ASSIGN                                                   !0, $4
    4     6        ASSIGN                                                   !1, <array>
    6     7        ASSIGN                                                   !2, 1
    7     8        ASSIGN                                                   !2, 1
          9      > JMP                                                      ->28
    8    10    > > JMP                                                      ->20
    9    11    >   INIT_FCALL                                               'array_rand'
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                         $9      
         14        ASSIGN                                                   !3, $9
   11    15        FETCH_DIM_R                                      ~13     !0, !3
         16        FETCH_DIM_W                                      $11     !1, !2
         17        ASSIGN_DIM                                               $11
         18        OP_DATA                                                  ~13
   13    19        UNSET_DIM                                                !0, !3
    8    20    >   ISSET_ISEMPTY_CV                                 ~14     !0
         21        BOOL_NOT                                         ~15     ~14
         22      > JMPZ_EX                                          ~15     ~15, ->26
         23    >   COUNT                                            ~16     !1
         24        IS_SMALLER                                       ~17     ~16, 4
         25        BOOL                                             ~15     ~17
         26    > > JMPNZ                                                    ~15, ->11
    7    27    >   PRE_INC                                                  !2
         28    >   IS_SMALLER_OR_EQUAL                                      !2, 8
         29      > JMPNZ                                                    ~19, ->10
   16    30    >   INIT_FCALL                                               'var_dump'
         31        CONCAT                                           ~20     !1, !2
         32        SEND_VAL                                                 ~20
         33        DO_ICALL                                                 
   17    34        INIT_FCALL                                               'var_dump'
         35        SEND_VAR                                                 !0
         36        DO_ICALL                                                 
         37      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.97 ms | 1392 KiB | 19 Q