3v4l.org

run code in 500+ 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 'COLLISION: ' . $result . PHP_EOL; echo 'AFTER: ' . count($gens) . PHP_EOL; die; } else { $gens[] = $result; } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 52
Branch analysis from position: 52
2 jumps found. (Code = 44) Position 1 = 54, Position 2 = 3
Branch analysis from position: 54
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 = 39, Position 2 = 49
Branch analysis from position: 39
1 jumps found. (Code = 61) Position 1 = -2
Branch analysis from position: 49
2 jumps found. (Code = 44) Position 1 = 54, Position 2 = 3
Branch analysis from position: 54
Branch analysis from position: 3
Branch analysis from position: 18
Branch analysis from position: 11
filename:       /in/hhg3G
function name:  (null)
number of ops:  55
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                                                          ->52
    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        FRAMELESS_ICALL_2                in_array            ~26     !5, !0
         38      > JMPZ                                                         ~26, ->49
   24    39    >   CONCAT                                               ~27     'COLLISION%3A+', !5
         40        CONCAT                                               ~28     ~27, '%0A'
         41        ECHO                                                         ~28
   25    42        COUNT                                                ~29     !0
         43        CONCAT                                               ~30     'AFTER%3A+', ~29
         44        CONCAT                                               ~31     ~30, '%0A'
         45        ECHO                                                         ~31
   26    46      > INIT_FCALL                                                   'exit'
         47*       DO_ICALL                                                     
   23    48*       JMP                                                          ->51
   28    49    >   ASSIGN_DIM                                                   !0
         50        OP_DATA                                                      !5
    5    51        PRE_INC                                                      !1
         52    >   IS_SMALLER                                                   !1, 1000
         53      > JMPNZ                                                        ~35, ->3
   30    54    > > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
162.07 ms | 1257 KiB | 21 Q