3v4l.org

run code in 300+ PHP versions simultaneously
<?php $hashes = array_map(function ($num) { return substr(md5($num), 0, 8); }, range(0, 100000000)); print_r(array_slice($hashes, 0, 10)); if (array_unique($hashes) == $hashes) { echo 'all unique'; } else { echo 'collisions detected'; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 25
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/liaDn
function name:  (null)
number of ops:  27
compiled vars:  !0 = $hashes
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'array_map'
          1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FliaDn%3A3%240'
          2        SEND_VAL                                                 ~1
          3        INIT_FCALL                                               'range'
          4        SEND_VAL                                                 0
          5        SEND_VAL                                                 100000000
          6        DO_ICALL                                         $2      
          7        SEND_VAR                                                 $2
          8        DO_ICALL                                         $3      
          9        ASSIGN                                                   !0, $3
    5    10        INIT_FCALL                                               'print_r'
         11        INIT_FCALL                                               'array_slice'
         12        SEND_VAR                                                 !0
         13        SEND_VAL                                                 0
         14        SEND_VAL                                                 10
         15        DO_ICALL                                         $5      
         16        SEND_VAR                                                 $5
         17        DO_ICALL                                                 
    7    18        INIT_FCALL                                               'array_unique'
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                         $7      
         21        IS_EQUAL                                                 !0, $7
         22      > JMPZ                                                     ~8, ->25
    8    23    >   ECHO                                                     'all+unique'
         24      > JMP                                                      ->26
   10    25    >   ECHO                                                     'collisions+detected'
   11    26    > > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FliaDn%3A3%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/liaDn
function name:  {closure}
number of ops:  11
compiled vars:  !0 = $num
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'substr'
          2        INIT_FCALL                                               'md5'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $1      
          5        SEND_VAR                                                 $1
          6        SEND_VAL                                                 0
          7        SEND_VAL                                                 8
          8        DO_ICALL                                         $2      
          9      > RETURN                                                   $2
         10*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FliaDn%3A3%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.88 ms | 1400 KiB | 27 Q