3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tstart = microtime(true); $numberOfRandoms = 500; $uniques = array(); do { $uniques[mt_rand(10000, 99999)] = true; } while(count(array_keys($uniques)) < $numberOfRandoms); $uniques = array_keys($uniques); $elapsed = $tstart - $start; echo $elapsed . PHP_EOL;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 6
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
filename:       /in/Sp3F2
function name:  (null)
number of ops:  27
compiled vars:  !0 = $tstart, !1 = $numberOfRandoms, !2 = $uniques, !3 = $elapsed, !4 = $start
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'microtime'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                         $5      
          3        ASSIGN                                                   !0, $5
    5     4        ASSIGN                                                   !1, 500
    7     5        ASSIGN                                                   !2, <array>
    9     6    >   INIT_FCALL                                               'mt_rand'
          7        SEND_VAL                                                 10000
          8        SEND_VAL                                                 99999
          9        DO_ICALL                                         $9      
         10        ASSIGN_DIM                                               !2, $9
         11        OP_DATA                                                  <true>
   10    12        INIT_FCALL                                               'array_keys'
         13        SEND_VAR                                                 !2
         14        DO_ICALL                                         $11     
         15        COUNT                                            ~12     $11
         16        IS_SMALLER                                               ~12, !1
         17      > JMPNZ                                                    ~13, ->6
   12    18    >   INIT_FCALL                                               'array_keys'
         19        SEND_VAR                                                 !2
         20        DO_ICALL                                         $14     
         21        ASSIGN                                                   !2, $14
   14    22        SUB                                              ~16     !0, !4
         23        ASSIGN                                                   !3, ~16
   15    24        CONCAT                                           ~18     !3, '%0A'
         25        ECHO                                                     ~18
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.58 ms | 1395 KiB | 19 Q