3v4l.org

run code in 300+ PHP versions simultaneously
<?php // generate random string given length function genString($length = 22){ $s = ''; $chars = array_merge(range('A','Z'), range('a','z'), range(0,9)); while($length > 0){ $randKey = array_rand($chars, 1); $s .= $chars[$randKey]; $length--; } return $s; } $digit = (PHP_VERSION_ID >= 50307) ? 'y' : 'a'; $salt = '$2'.$digit.'$10$'.genString(); //echo 'Salt: '.$salt.'<br>'; $password = 'password'; $hash = crypt($password, $salt); echo 'Strlen: '.strlen($hash).' ------ '; if (crypt($password, $hash) == $hash) { echo "Password verified!"; } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 1, Position 2 = 3
Branch analysis from position: 1
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 28
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 28
Branch analysis from position: 27
Branch analysis from position: 28
filename:       /in/o1DWo
function name:  (null)
number of ops:  29
compiled vars:  !0 = $digit, !1 = $salt, !2 = $password, !3 = $hash
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E > > JMPZ                                                     <true>, ->3
          1    >   QM_ASSIGN                                        ~4      'y'
          2      > JMP                                                      ->4
          3    >   QM_ASSIGN                                        ~4      'a'
          4    >   ASSIGN                                                   !0, ~4
   16     5        CONCAT                                           ~6      '%242', !0
          6        CONCAT                                           ~7      ~6, '%2410%24'
          7        INIT_FCALL                                               'genstring'
          8        DO_FCALL                                      0  $8      
          9        CONCAT                                           ~9      ~7, $8
         10        ASSIGN                                                   !1, ~9
   20    11        ASSIGN                                                   !2, 'password'
   21    12        INIT_FCALL                                               'crypt'
         13        SEND_VAR                                                 !2
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                         $12     
         16        ASSIGN                                                   !3, $12
   23    17        STRLEN                                           ~14     !3
         18        CONCAT                                           ~15     'Strlen%3A+', ~14
         19        CONCAT                                           ~16     ~15, '+------+'
         20        ECHO                                                     ~16
   25    21        INIT_FCALL                                               'crypt'
         22        SEND_VAR                                                 !2
         23        SEND_VAR                                                 !3
         24        DO_ICALL                                         $17     
         25        IS_EQUAL                                                 !3, $17
         26      > JMPZ                                                     ~18, ->28
   26    27    >   ECHO                                                     'Password+verified%21'
   29    28    > > RETURN                                                   1

Function genstring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 31, Position 2 = 21
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
2 jumps found. (Code = 44) Position 1 = 31, Position 2 = 21
Branch analysis from position: 31
Branch analysis from position: 21
filename:       /in/o1DWo
function name:  genString
number of ops:  33
compiled vars:  !0 = $length, !1 = $s, !2 = $chars, !3 = $randKey
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV_INIT                                        !0      22
    5     1        ASSIGN                                                   !1, ''
    6     2        INIT_FCALL                                               'array_merge'
          3        INIT_FCALL                                               'range'
          4        SEND_VAL                                                 'A'
          5        SEND_VAL                                                 'Z'
          6        DO_ICALL                                         $5      
          7        SEND_VAR                                                 $5
          8        INIT_FCALL                                               'range'
          9        SEND_VAL                                                 'a'
         10        SEND_VAL                                                 'z'
         11        DO_ICALL                                         $6      
         12        SEND_VAR                                                 $6
         13        INIT_FCALL                                               'range'
         14        SEND_VAL                                                 0
         15        SEND_VAL                                                 9
         16        DO_ICALL                                         $7      
         17        SEND_VAR                                                 $7
         18        DO_ICALL                                         $8      
         19        ASSIGN                                                   !2, $8
    7    20      > JMP                                                      ->29
    8    21    >   INIT_FCALL                                               'array_rand'
         22        SEND_VAR                                                 !2
         23        SEND_VAL                                                 1
         24        DO_ICALL                                         $10     
         25        ASSIGN                                                   !3, $10
    9    26        FETCH_DIM_R                                      ~12     !2, !3
         27        ASSIGN_OP                                     8          !1, ~12
   10    28        PRE_DEC                                                  !0
    7    29    >   IS_SMALLER                                               0, !0
         30      > JMPNZ                                                    ~15, ->21
   12    31    > > RETURN                                                   !1
   13    32*     > RETURN                                                   null

End of function genstring

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.82 ms | 1403 KiB | 22 Q