3v4l.org

run code in 300+ PHP versions simultaneously
<?php $t = range(1, 32, 1); $g = []; while (!empty($t) && count($g) < 4) { $key = array_rand($t); $g[] = $t[$key]; unset($t[$key]); } var_dump($g); var_dump($t);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
2 jumps found. (Code = 46) Position 1 = 19, Position 2 = 22
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 23, Position 2 = 8
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 46) Position 1 = 19, Position 2 = 22
Branch analysis from position: 19
Branch analysis from position: 22
Branch analysis from position: 22
filename:       /in/uV82r
function name:  (null)
number of ops:  30
compiled vars:  !0 = $t, !1 = $g, !2 = $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                                         $3      
          5        ASSIGN                                                   !0, $3
    4     6        ASSIGN                                                   !1, <array>
    6     7      > JMP                                                      ->16
    7     8    >   INIT_FCALL                                               'array_rand'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $6      
         11        ASSIGN                                                   !2, $6
    9    12        FETCH_DIM_R                                      ~9      !0, !2
         13        ASSIGN_DIM                                               !1
         14        OP_DATA                                                  ~9
   11    15        UNSET_DIM                                                !0, !2
    6    16    >   ISSET_ISEMPTY_CV                                 ~10     !0
         17        BOOL_NOT                                         ~11     ~10
         18      > JMPZ_EX                                          ~11     ~11, ->22
         19    >   COUNT                                            ~12     !1
         20        IS_SMALLER                                       ~13     ~12, 4
         21        BOOL                                             ~11     ~13
         22    > > JMPNZ                                                    ~11, ->8
   14    23    >   INIT_FCALL                                               'var_dump'
         24        SEND_VAR                                                 !1
         25        DO_ICALL                                                 
   15    26        INIT_FCALL                                               'var_dump'
         27        SEND_VAR                                                 !0
         28        DO_ICALL                                                 
         29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.89 ms | 1396 KiB | 19 Q