3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $h='$5$qNElXs2yMnL2.GNS3kiM7DqmGbFLdQfIwu2691aJgT3xgJazPLtw7RPKz3Dp8RIc4b5fmJ7qvlq/mPN8a.rE40'; $p='salasana'; $c=crypt($p,$h); var_dump(CRYPT_SHA512); echo "HASH: $h - CRYPT: $c\n"; if ($c == $h) { echo "MATCH OK\n"; } else { echo "NO MATCH\n"; } ?>
Output for 5.3.2 - 7.1.0
int(1) HASH: $5$qNElXs2yMnL2.GNS3kiM7DqmGbFLdQfIwu2691aJgT3xgJazPLtw7RPKz3Dp8RIc4b5fmJ7qvlq/mPN8a.rE40 - CRYPT: $5$qNElXs2yMnL2.GNS$lLwtZWf1AuCmwi0g6g7.V8XbAooOnljWTTrWA.BGrI6 NO MATCH
Output for 5.3.0 - 5.3.1
Notice: Use of undefined constant CRYPT_SHA512 - assumed 'CRYPT_SHA512' in /in/kfhPb on line 6 string(12) "CRYPT_SHA512" HASH: $5$qNElXs2yMnL2.GNS3kiM7DqmGbFLdQfIwu2691aJgT3xgJazPLtw7RPKz3Dp8RIc4b5fmJ7qvlq/mPN8a.rE40 - CRYPT: $5RaKybDiy4zw NO MATCH
Output for 4.3.0 - 5.2.17
Notice: Use of undefined constant CRYPT_SHA512 - assumed 'CRYPT_SHA512' in /in/kfhPb on line 6 string(12) "CRYPT_SHA512" HASH: $5$qNElXs2yMnL2.GNS3kiM7DqmGbFLdQfIwu2691aJgT3xgJazPLtw7RPKz3Dp8RIc4b5fmJ7qvlq/mPN8a.rE40 - CRYPT: $5$qNElXs2yM$p9MdmneHsuPtnLMKt4SeK0swZHa5C.ery/jowBgtoHB NO MATCH