3v4l.org

run code in 300+ PHP versions simultaneously
<?php $r = new \Random\Randomizer(); $chars = 'abcdefghijklmnopqrstuvwxyz0123456789'; $lens = [10, 100, 1000, 1024 * 1024, 1024 * 1024 * 10]; // bcrypt foreach ($lens as $len) { $pw = $r->getBytesFromString($chars, $len); $time = microtime(true); password_hash($pw, PASSWORD_DEFAULT); echo microtime(true) - $time . ' ms (bcrypt ' . strlen($pw) . " chars)\n"; } // PBKDF2 foreach ($lens as $len) { $pw = $r->getBytesFromString($chars, $len); $time = microtime(true); hash_pbkdf2('sha256', $pw, 'salt', 100000); echo microtime(true) - $time . ' ms (PBKDF2 ' . strlen($pw) . " chars)\n"; } // SHA-1 $time = microtime(true); foreach ($lens as $len) { $pw = $r->getBytesFromString($chars, $len); $time = microtime(true); sha1($pw); echo microtime(true) - $time . ' ms (SHA-1 ' . strlen($pw) . " chars)\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 30
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 30
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 30
2 jumps found. (Code = 77) Position 1 = 32, Position 2 = 58
Branch analysis from position: 32
2 jumps found. (Code = 78) Position 1 = 33, Position 2 = 58
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
Branch analysis from position: 58
2 jumps found. (Code = 77) Position 1 = 64, Position 2 = 87
Branch analysis from position: 64
2 jumps found. (Code = 78) Position 1 = 65, Position 2 = 87
Branch analysis from position: 65
1 jumps found. (Code = 42) Position 1 = 64
Branch analysis from position: 64
Branch analysis from position: 87
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 87
Branch analysis from position: 58
Branch analysis from position: 30
filename:       /in/rMd8D
function name:  (null)
number of ops:  89
compiled vars:  !0 = $r, !1 = $chars, !2 = $lens, !3 = $len, !4 = $pw, !5 = $time
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $6      'Random%5CRandomizer'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $6
    3     3        ASSIGN                                                   !1, 'abcdefghijklmnopqrstuvwxyz0123456789'
    4     4        ASSIGN                                                   !2, <array>
    7     5      > FE_RESET_R                                       $11     !2, ->30
          6    > > FE_FETCH_R                                               $11, !3, ->30
    8     7    >   INIT_METHOD_CALL                                         !0, 'getBytesFromString'
          8        SEND_VAR_EX                                              !1
          9        SEND_VAR_EX                                              !3
         10        DO_FCALL                                      0  $12     
         11        ASSIGN                                                   !4, $12
    9    12        INIT_FCALL                                               'microtime'
         13        SEND_VAL                                                 <true>
         14        DO_ICALL                                         $14     
         15        ASSIGN                                                   !5, $14
   10    16        INIT_FCALL                                               'password_hash'
         17        SEND_VAR                                                 !4
         18        SEND_VAL                                                 '2y'
         19        DO_ICALL                                                 
   11    20        INIT_FCALL                                               'microtime'
         21        SEND_VAL                                                 <true>
         22        DO_ICALL                                         $17     
         23        SUB                                              ~18     $17, !5
         24        CONCAT                                           ~19     ~18, '+ms+%28bcrypt+'
         25        STRLEN                                           ~20     !4
         26        CONCAT                                           ~21     ~19, ~20
         27        CONCAT                                           ~22     ~21, '+chars%29%0A'
         28        ECHO                                                     ~22
    7    29      > JMP                                                      ->6
         30    >   FE_FREE                                                  $11
   15    31      > FE_RESET_R                                       $23     !2, ->58
         32    > > FE_FETCH_R                                               $23, !3, ->58
   16    33    >   INIT_METHOD_CALL                                         !0, 'getBytesFromString'
         34        SEND_VAR_EX                                              !1
         35        SEND_VAR_EX                                              !3
         36        DO_FCALL                                      0  $24     
         37        ASSIGN                                                   !4, $24
   17    38        INIT_FCALL                                               'microtime'
         39        SEND_VAL                                                 <true>
         40        DO_ICALL                                         $26     
         41        ASSIGN                                                   !5, $26
   18    42        INIT_FCALL                                               'hash_pbkdf2'
         43        SEND_VAL                                                 'sha256'
         44        SEND_VAR                                                 !4
         45        SEND_VAL                                                 'salt'
         46        SEND_VAL                                                 100000
         47        DO_ICALL                                                 
   19    48        INIT_FCALL                                               'microtime'
         49        SEND_VAL                                                 <true>
         50        DO_ICALL                                         $29     
         51        SUB                                              ~30     $29, !5
         52        CONCAT                                           ~31     ~30, '+ms+%28PBKDF2+'
         53        STRLEN                                           ~32     !4
         54        CONCAT                                           ~33     ~31, ~32
         55        CONCAT                                           ~34     ~33, '+chars%29%0A'
         56        ECHO                                                     ~34
   15    57      > JMP                                                      ->32
         58    >   FE_FREE                                                  $23
   23    59        INIT_FCALL                                               'microtime'
         60        SEND_VAL                                                 <true>
         61        DO_ICALL                                         $35     
         62        ASSIGN                                                   !5, $35
   24    63      > FE_RESET_R                                       $37     !2, ->87
         64    > > FE_FETCH_R                                               $37, !3, ->87
   25    65    >   INIT_METHOD_CALL                                         !0, 'getBytesFromString'
         66        SEND_VAR_EX                                              !1
         67        SEND_VAR_EX                                              !3
         68        DO_FCALL                                      0  $38     
         69        ASSIGN                                                   !4, $38
   26    70        INIT_FCALL                                               'microtime'
         71        SEND_VAL                                                 <true>
         72        DO_ICALL                                         $40     
         73        ASSIGN                                                   !5, $40
   27    74        INIT_FCALL                                               'sha1'
         75        SEND_VAR                                                 !4
         76        DO_ICALL                                                 
   28    77        INIT_FCALL                                               'microtime'
         78        SEND_VAL                                                 <true>
         79        DO_ICALL                                         $43     
         80        SUB                                              ~44     $43, !5
         81        CONCAT                                           ~45     ~44, '+ms+%28SHA-1+'
         82        STRLEN                                           ~46     !4
         83        CONCAT                                           ~47     ~45, ~46
         84        CONCAT                                           ~48     ~47, '+chars%29%0A'
         85        ECHO                                                     ~48
   24    86      > JMP                                                      ->64
         87    >   FE_FREE                                                  $37
   29    88      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.9 ms | 1014 KiB | 17 Q