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; if (strlen($str) > 500) { echo "Could not detect trunction after 500 characters for $algo...giving up...\n\n"; break; } } 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"; }

Abusive script

This script was stopped while abusing our resources

Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 52
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 52
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 = 43) Position 1 = 26, Position 2 = 31
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 31
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 6
Branch analysis from position: 32
Branch analysis from position: 6
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 31
Branch analysis from position: 26
Branch analysis from position: 31
Branch analysis from position: 52
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 52
filename:       /in/nlc2e
function name:  (null)
number of ops:  54
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, ->52
          4    > > FE_FETCH_R                                       ~12     $11, !3, ->52
          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    >   STRLEN                                           ~23     !0
         24        IS_SMALLER                                               500, ~23
         25      > JMPZ                                                     ~24, ->31
   17    26    >   ROPE_INIT                                     3  ~26     'Could+not+detect+trunction+after+500+characters+for+'
         27        ROPE_ADD                                      1  ~26     ~26, !4
         28        ROPE_END                                      2  ~25     ~26, '...giving+up...%0A%0A'
         29        ECHO                                                     ~25
   18    30      > JMP                                                      ->32
   20    31    > > JMPNZ                                                    !5, ->6
   22    32    >   STRLEN                                           ~28     !0
         33        CONCAT                                           ~29     'Stopped+at+', ~28
         34        ROPE_INIT                                     3  ~31     '+characters+for+salt+'
         35        ROPE_ADD                                      1  ~31     ~31, !4
         36        ROPE_END                                      2  ~30     ~31, '+before+truncation+was+detected...%0A%0A'
         37        CONCAT                                           ~33     ~29, ~30
         38        ECHO                                                     ~33
   23    39        INIT_FCALL                                               'array_pop'
         40        SEND_REF                                                 !1
         41        DO_ICALL                                         $34     
         42        ASSIGN                                                   !6, $34
   24    43        INIT_FCALL                                               'array_pop'
         44        SEND_REF                                                 !1
         45        DO_ICALL                                         $36     
         46        ASSIGN                                                   !7, $36
   25    47        ROPE_INIT                                     3  ~39     !7
         48        ROPE_ADD                                      1  ~39     ~39, '%0A'
         49        ROPE_END                                      2  ~38     ~39, !6
         50        ECHO                                                     ~38
    7    51      > JMP                                                      ->4
         52    >   FE_FREE                                                  $11
   27    53      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.41 ms | 1392 KiB | 19 Q