3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = ''; $hashes = array(); $salts = array('BCRYPT' => '$2a$04$1234567890123456789012', 'SHA256' => '$5$rounds=1000$usesomesillystringforsalt$','SHA512' => '$6$rounds=1000$usesomesillystringforsalt$', 'MD5' => '$1$rasmusle$'); foreach ($salts as $algo => $salt) { do { $str .= '0'; $hashes[] = crypt($str, $salt); if (count(array_unique($hashes)) === count($hashes)) $allUnique = true; else $allUnique = false; } while($allUnique); echo "Stopped at " . strlen($str) . " characters for salt $algo before truncation was detected...\n\n"; $lst = array_pop($hashes); $stl = array_pop($hashes); echo "$stl\n$lst"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 44
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 44
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 22
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
2 jumps found. (Code = 44) Position 1 = 24, Position 2 = 6
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 6
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 24, Position 2 = 6
Branch analysis from position: 24
Branch analysis from position: 6
Branch analysis from position: 44
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 44
filename:       /in/ZmnUM
function name:  (null)
number of ops:  46
compiled vars:  !0 = $str, !1 = $hashes, !2 = $salts, !3 = $salt, !4 = $algo, !5 = $allUnique, !6 = $lst, !7 = $stl
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, ''
    3     1        ASSIGN                                                   !1, <array>
    5     2        ASSIGN                                                   !2, <array>
    7     3      > FE_RESET_R                                       $11     !2, ->44
          4    > > FE_FETCH_R                                       ~12     $11, !3, ->44
          5    >   ASSIGN                                                   !4, ~12
   10     6    >   ASSIGN_OP                                     8          !0, '0'
   11     7        INIT_FCALL                                               'crypt'
          8        SEND_VAR                                                 !0
          9        SEND_VAR                                                 !3
         10        DO_ICALL                                         $16     
         11        ASSIGN_DIM                                               !1
         12        OP_DATA                                                  $16
   12    13        INIT_FCALL                                               'array_unique'
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                         $17     
         16        COUNT                                            ~18     $17
         17        COUNT                                            ~19     !1
         18        IS_IDENTICAL                                             ~18, ~19
         19      > JMPZ                                                     ~20, ->22
   13    20    >   ASSIGN                                                   !5, <true>
         21      > JMP                                                      ->23
   15    22    >   ASSIGN                                                   !5, <false>
   16    23    > > JMPNZ                                                    !5, ->6
   18    24    >   STRLEN                                           ~23     !0
         25        CONCAT                                           ~24     'Stopped+at+', ~23
         26        ROPE_INIT                                     3  ~26     '+characters+for+salt+'
         27        ROPE_ADD                                      1  ~26     ~26, !4
         28        ROPE_END                                      2  ~25     ~26, '+before+truncation+was+detected...%0A%0A'
         29        CONCAT                                           ~28     ~24, ~25
         30        ECHO                                                     ~28
   19    31        INIT_FCALL                                               'array_pop'
         32        SEND_REF                                                 !1
         33        DO_ICALL                                         $29     
         34        ASSIGN                                                   !6, $29
   20    35        INIT_FCALL                                               'array_pop'
         36        SEND_REF                                                 !1
         37        DO_ICALL                                         $31     
         38        ASSIGN                                                   !7, $31
   21    39        ROPE_INIT                                     3  ~34     !7
         40        ROPE_ADD                                      1  ~34     ~34, '%0A'
         41        ROPE_END                                      2  ~33     ~34, !6
         42        ECHO                                                     ~33
    7    43      > JMP                                                      ->4
         44    >   FE_FREE                                                  $11
   23    45      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.74 ms | 1400 KiB | 19 Q