3v4l.org

run code in 300+ PHP versions simultaneously
<?php $gens = []; for ($i = 0; $i < 1000; $i++) { $entropy=1; if (function_exists("posix_getpid")) $entropy *= posix_getpid(); if (function_exists("memory_get_usage")) $entropy *= memory_get_usage(); list($usec, $sec) = explode(" ", microtime()); $usec *= 1000000; $entropy *= $usec; mt_srand($entropy); $result = mt_rand(); if (in_array($result, $gens)) { echo 'Count: ' . count($gens) . PHP_EOL; echo 'COLLISION: ' . $result . PHP_EOL; } else { $gens[] = $result; } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 53
Branch analysis from position: 53
2 jumps found. (Code = 44) Position 1 = 55, Position 2 = 3
Branch analysis from position: 55
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 11
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 18
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 42, Position 2 = 50
Branch analysis from position: 42
1 jumps found. (Code = 42) Position 1 = 52
Branch analysis from position: 52
2 jumps found. (Code = 44) Position 1 = 55, Position 2 = 3
Branch analysis from position: 55
Branch analysis from position: 3
Branch analysis from position: 50
2 jumps found. (Code = 44) Position 1 = 55, Position 2 = 3
Branch analysis from position: 55
Branch analysis from position: 3
Branch analysis from position: 18
Branch analysis from position: 11
filename:       /in/enG8K
function name:  (null)
number of ops:  56
compiled vars:  !0 = $gens, !1 = $i, !2 = $entropy, !3 = $usec, !4 = $sec, !5 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        ASSIGN                                                   !1, 0
          2      > JMP                                                      ->53
    6     3    >   ASSIGN                                                   !2, 1
    8     4        INIT_FCALL                                               'function_exists'
          5        SEND_VAL                                                 'posix_getpid'
          6        DO_ICALL                                         $9      
          7      > JMPZ                                                     $9, ->11
    9     8    >   INIT_FCALL                                               'posix_getpid'
          9        DO_ICALL                                         $10     
         10        ASSIGN_OP                                     3          !2, $10
   11    11    >   INIT_FCALL                                               'function_exists'
         12        SEND_VAL                                                 'memory_get_usage'
         13        DO_ICALL                                         $12     
         14      > JMPZ                                                     $12, ->18
   12    15    >   INIT_FCALL                                               'memory_get_usage'
         16        DO_ICALL                                         $13     
         17        ASSIGN_OP                                     3          !2, $13
   14    18    >   INIT_FCALL                                               'explode'
         19        SEND_VAL                                                 '+'
         20        INIT_FCALL                                               'microtime'
         21        DO_ICALL                                         $15     
         22        SEND_VAR                                                 $15
         23        DO_ICALL                                         $16     
         24        FETCH_LIST_R                                     $17     $16, 0
         25        ASSIGN                                                   !3, $17
         26        FETCH_LIST_R                                     $19     $16, 1
         27        ASSIGN                                                   !4, $19
         28        FREE                                                     $16
   16    29        ASSIGN_OP                                     3          !3, 1000000
   17    30        ASSIGN_OP                                     3          !2, !3
   19    31        INIT_FCALL                                               'mt_srand'
         32        SEND_VAR                                                 !2
         33        DO_ICALL                                                 
   21    34        INIT_FCALL                                               'mt_rand'
         35        DO_ICALL                                         $24     
         36        ASSIGN                                                   !5, $24
   23    37        INIT_FCALL                                               'in_array'
         38        SEND_VAR                                                 !5
         39        SEND_VAR                                                 !0
         40        DO_ICALL                                         $26     
         41      > JMPZ                                                     $26, ->50
   24    42    >   COUNT                                            ~27     !0
         43        CONCAT                                           ~28     'Count%3A+', ~27
         44        CONCAT                                           ~29     ~28, '%0A'
         45        ECHO                                                     ~29
   25    46        CONCAT                                           ~30     'COLLISION%3A+', !5
         47        CONCAT                                           ~31     ~30, '%0A'
         48        ECHO                                                     ~31
         49      > JMP                                                      ->52
   27    50    >   ASSIGN_DIM                                               !0
         51        OP_DATA                                                  !5
    5    52    >   PRE_INC                                                  !1
         53    >   IS_SMALLER                                               !1, 1000
         54      > JMPNZ                                                    ~34, ->3
   29    55    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
183.82 ms | 1400 KiB | 29 Q