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();

preferences:
34.94 ms | 402 KiB | 5 Q