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; } $prefix = (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/oP1Th
function name:  (null)
number of ops:  29
compiled vars:  !0 = $prefix, !1 = $salt, !2 = $digit, !3 = $password, !4 = $hash
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E > > JMPZ                                                     <true>, ->3
          1    >   QM_ASSIGN                                        ~5      'y'
          2      > JMP                                                      ->4
          3    >   QM_ASSIGN                                        ~5      'a'
          4    >   ASSIGN                                                   !0, ~5
   16     5        CONCAT                                           ~7      '%242', !2
          6        CONCAT                                           ~8      ~7, '%2410%24'
          7        INIT_FCALL                                               'genstring'
          8        DO_FCALL                                      0  $9      
          9        CONCAT                                           ~10     ~8, $9
         10        ASSIGN                                                   !1, ~10
   20    11        ASSIGN                                                   !3, 'password'
   21    12        INIT_FCALL                                               'crypt'
         13        SEND_VAR                                                 !3
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                         $13     
         16        ASSIGN                                                   !4, $13
   23    17        STRLEN                                           ~15     !4
         18        CONCAT                                           ~16     'Strlen%3A+', ~15
         19        CONCAT                                           ~17     ~16, '+------+'
         20        ECHO                                                     ~17
   25    21        INIT_FCALL                                               'crypt'
         22        SEND_VAR                                                 !3
         23        SEND_VAR                                                 !4
         24        DO_ICALL                                         $18     
         25        IS_EQUAL                                                 !4, $18
         26      > JMPZ                                                     ~19, ->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/oP1Th
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:
146.75 ms | 1402 KiB | 22 Q