3v4l.org

run code in 300+ PHP versions simultaneously
<?php $uniqueIds = []; while(count($uniqueIds) < 5) { $randomNumber = rand(1000, 9999); if (!in_array($randomNumber, $uniqueIds)) { $uniqueIds[] = $randomNumber; } } var_dump($uniqueIds);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 2
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 15
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 2
Branch analysis from position: 18
Branch analysis from position: 2
Branch analysis from position: 15
filename:       /in/q5ntj
function name:  (null)
number of ops:  22
compiled vars:  !0 = $uniqueIds, !1 = $randomNumber
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1      > JMP                                                      ->15
    5     2    >   INIT_FCALL                                               'rand'
          3        SEND_VAL                                                 1000
          4        SEND_VAL                                                 9999
          5        DO_ICALL                                         $3      
          6        ASSIGN                                                   !1, $3
    6     7        INIT_FCALL                                               'in_array'
          8        SEND_VAR                                                 !1
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $5      
         11        BOOL_NOT                                         ~6      $5
         12      > JMPZ                                                     ~6, ->15
    7    13    >   ASSIGN_DIM                                               !0
         14        OP_DATA                                                  !1
    4    15    >   COUNT                                            ~8      !0
         16        IS_SMALLER                                               ~8, 5
         17      > JMPNZ                                                    ~9, ->2
   11    18    >   INIT_FCALL                                               'var_dump'
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.07 ms | 1395 KiB | 19 Q