3v4l.org

run code in 300+ PHP versions simultaneously
<?php $password = 'test'; $salt = 'testtesttesttesttesttesttest'; // pre-calculated hash using PHP 5.4 and the new flag $2y$ $hash = '$2y$10$testtesttesttesttesttetsVhdqssnPoru2WOCEBbSFwYnOfjwmG'; if (version_compare(PHP_VERSION, '5.3.7', '<')) { $hash = str_replace('$2y$','$2a$', $hash); echo "Changed the 2y in 2a\n"; } if ($hash === crypt($password, $hash)) { echo "OK!\n"; } else { echo "ERROR\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 16
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 24
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/aOStI
function name:  (null)
number of ops:  26
compiled vars:  !0 = $password, !1 = $salt, !2 = $hash
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'test'
    3     1        ASSIGN                                                   !1, 'testtesttesttesttesttesttest'
    6     2        ASSIGN                                                   !2, '%242y%2410%24testtesttesttesttesttetsVhdqssnPoru2WOCEBbSFwYnOfjwmG'
    8     3        INIT_FCALL                                               'version_compare'
          4        SEND_VAL                                                 '8.0.0'
          5        SEND_VAL                                                 '5.3.7'
          6        SEND_VAL                                                 '%3C'
          7        DO_ICALL                                         $6      
          8      > JMPZ                                                     $6, ->16
    9     9    >   INIT_FCALL                                               'str_replace'
         10        SEND_VAL                                                 '%242y%24'
         11        SEND_VAL                                                 '%242a%24'
         12        SEND_VAR                                                 !2
         13        DO_ICALL                                         $7      
         14        ASSIGN                                                   !2, $7
   10    15        ECHO                                                     'Changed+the+2y+in+2a%0A'
   12    16    >   INIT_FCALL                                               'crypt'
         17        SEND_VAR                                                 !0
         18        SEND_VAR                                                 !2
         19        DO_ICALL                                         $9      
         20        IS_IDENTICAL                                             !2, $9
         21      > JMPZ                                                     ~10, ->24
   13    22    >   ECHO                                                     'OK%21%0A'
         23      > JMP                                                      ->25
   15    24    >   ECHO                                                     'ERROR%0A'
   16    25    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.13 ms | 1395 KiB | 19 Q