3v4l.org

run code in 300+ PHP versions simultaneously
<?php function testCrypt() { // Create a random salt $salt = 'abcdefghij1234567890ab'; //format of Blowfish algorithm is "$2a$" followed by cost, or number of iterations (10) and then followed by random salt string $salt = "$2a$10$" . $salt; //this could be moved to index.php pr something like that. if (version_compare(PHP_VERSION, '5.3.0') < 0) die('Minimum reqirements for this application are PHP >= 5.3.0 and your version is: ' . phpversion()); //fix issue #22 if (version_compare(PHP_VERSION, '5.3.7') >= 0) $salt = "$2x$10$" . $salt; if (version_compare(PHP_VERSION, '5.3.7') < 0) $salt = "$2a$10$" . $salt; // Hash the password with the salt $hash = crypt('ksjdfhs346fsad$%%Aâklsdj9842*&', $salt); echo $hash; } testCrypt();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0JTE3
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   INIT_FCALL                                               'testcrypt'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   1

Function testcrypt:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 13
Branch analysis from position: 9
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 21
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 29
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
Branch analysis from position: 21
filename:       /in/0JTE3
function name:  testCrypt
number of ops:  36
compiled vars:  !0 = $salt, !1 = $hash
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   ASSIGN                                                   !0, 'abcdefghij1234567890ab'
    9     1        CONCAT                                           ~3      '%242a%2410%24', !0
          2        ASSIGN                                                   !0, ~3
   12     3        INIT_FCALL                                               'version_compare'
          4        SEND_VAL                                                 '8.0.0'
          5        SEND_VAL                                                 '5.3.0'
          6        DO_ICALL                                         $5      
          7        IS_SMALLER                                               $5, 0
          8      > JMPZ                                                     ~6, ->13
   13     9    >   INIT_FCALL                                               'phpversion'
         10        DO_ICALL                                         $7      
         11        CONCAT                                           ~8      'Minimum+reqirements+for+this+application+are+PHP+%3E%3D+5.3.0+and+your+version+is%3A+', $7
         12      > EXIT                                                     ~8
   18    13    >   INIT_FCALL                                               'version_compare'
         14        SEND_VAL                                                 '8.0.0'
         15        SEND_VAL                                                 '5.3.7'
         16        DO_ICALL                                         $9      
         17        IS_SMALLER_OR_EQUAL                                      0, $9
         18      > JMPZ                                                     ~10, ->21
   19    19    >   CONCAT                                           ~11     '%242x%2410%24', !0
         20        ASSIGN                                                   !0, ~11
   21    21    >   INIT_FCALL                                               'version_compare'
         22        SEND_VAL                                                 '8.0.0'
         23        SEND_VAL                                                 '5.3.7'
         24        DO_ICALL                                         $13     
         25        IS_SMALLER                                               $13, 0
         26      > JMPZ                                                     ~14, ->29
   22    27    >   CONCAT                                           ~15     '%242a%2410%24', !0
         28        ASSIGN                                                   !0, ~15
   25    29    >   INIT_FCALL                                               'crypt'
         30        SEND_VAL                                                 'ksjdfhs346fsad%24%25%25A%C3%A2klsdj9842%2A%26'
         31        SEND_VAR                                                 !0
         32        DO_ICALL                                         $17     
         33        ASSIGN                                                   !1, $17
   27    34        ECHO                                                     !1
   28    35      > RETURN                                                   null

End of function testcrypt

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.84 ms | 1407 KiB | 20 Q