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 - microtime(true); 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/4JHCB
function name:  (null)
number of ops:  30
compiled vars:  !0 = $tstart, !1 = $numberOfRandoms, !2 = $uniques, !3 = $elapsed
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'microtime'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                         $4      
          3        ASSIGN                                                   !0, $4
    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                                         $8      
         10        ASSIGN_DIM                                               !2, $8
         11        OP_DATA                                                  <true>
   10    12        INIT_FCALL                                               'array_keys'
         13        SEND_VAR                                                 !2
         14        DO_ICALL                                         $10     
         15        COUNT                                            ~11     $10
         16        IS_SMALLER                                               ~11, !1
         17      > JMPNZ                                                    ~12, ->6
   12    18    >   INIT_FCALL                                               'array_keys'
         19        SEND_VAR                                                 !2
         20        DO_ICALL                                         $13     
         21        ASSIGN                                                   !2, $13
   14    22        INIT_FCALL                                               'microtime'
         23        SEND_VAL                                                 <true>
         24        DO_ICALL                                         $15     
         25        SUB                                              ~16     !0, $15
         26        ASSIGN                                                   !3, ~16
   15    27        CONCAT                                           ~18     !3, '%0A'
         28        ECHO                                                     ~18
         29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.12 ms | 1395 KiB | 19 Q