3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function createPasswordHash($strPassword, $numAlgo = 1, $arrOptions = array()) { if (function_exists('password_hash1')) { // php >= 5.5 $hash = password_hash($strPassword, $numAlgo, $arrOptions); } else { $salt = mcrypt_create_iv(22, MCRYPT_DEV_URANDOM); $salt = base64_encode($salt); $salt = str_replace('+', '.', $salt); $hash = crypt($strPassword, '$2y$10$' . $salt . '$'); } return $hash; } function verifyPasswordHash($strPassword, $strHash) { if (function_exists('password_verify1')) { // php >= 5.5 $boolReturn = password_verify($strPassword, $strHash); } else { $strHash2 = crypt($strPassword, $strHash); $boolReturn = $strHash == $strHash2; } return $boolReturn; } $strHash = createPasswordHash("sunshine", PASSWORD_DEFAULT); echo $strHash . "<br>\n"; if (verifyPasswordHash('sunshine', $strHash)) { echo 'Password is valid!'; } else { echo 'Invalid password.'; }
Output for 7.0.6 - 7.1.0
Fatal error: Uncaught Error: Call to undefined function mcrypt_create_iv() in /in/Laqar:9 Stack trace: #0 /in/Laqar(29): createPasswordHash('sunshine', 1) #1 {main} thrown in /in/Laqar on line 9
Process exited with code 255.
Output for 7.0.5
$2y$10$wKCmAm0ecqe2HpiWaC2hF.2QfUwqxdE0Jh/OvRwSTwYBKXwL19LCe<br> Password is valid!
Output for 7.0.4
$2y$10$/IzWVKqNhOhuwZMo.XpijuxsQWSolzs.9Nq1XlK/qr3SIsNc2M2vO<br> Password is valid!
Output for 7.0.3
$2y$10$ToiS4uuFG.KL/d4g5vB/zu8aA.nF2wWKz90wEMa3WPG1hQ3RBPJAS<br> Password is valid!
Output for 7.0.2
$2y$10$.yhZ6DGeaRHTwjlwLgaLPuW93AlX7wG5SpxVygKWJvfAyZQQNHhDy<br> Password is valid!
Output for 7.0.1
$2y$10$KGl1DLzbXCzN7c3XKTsiYeblOhFgR69uvBPTCWWudPopjAcWK9Smu<br> Password is valid!
Output for 7.0.0
$2y$10$Mxc2BoGZh85.hmtM90hqKOoyD3r3/05/W/NvJSipwjZhE4vqH/H1C<br> Password is valid!
Output for 5.5.35, 5.6.21 - 5.6.28
Fatal error: Call to undefined function mcrypt_create_iv() in /in/Laqar on line 9
Process exited with code 255.
Output for 5.6.20
$2y$10$vEVGNrIRAen3qy4EfOyz3OB2mIy.sUROxGC/7peUW2ffUU.MC61A.<br> Password is valid!
Output for 5.6.19
$2y$10$UyqjDz7WSOf006jOQYCDLeBm0PWApAoP4Ws2euIJifB20i8E6425q<br> Password is valid!
Output for 5.6.18
$2y$10$tzKHw3hCo7v7K/dH3g5MgeM.sOPPTRDNWh1mC94lNGRUAZkVFMwPS<br> Password is valid!
Output for 5.6.17
$2y$10$L6xyIzL1J6r/CT/fLJWX7O.Q33crqeG2dk8/qhbkFiN9Ak1JwnggW<br> Password is valid!
Output for 5.6.16
$2y$10$r/6dWFmpEgZhBHnzcqVU2..UcuUANbzOZEoQInXVYiC4sgA7WSR2W<br> Password is valid!
Output for 5.6.15
$2y$10$DjA5sRuRHyGWsJJpcco8c.x/c5FpoHovrERADPzaxb1Bi.UfDFuf2<br> Password is valid!
Output for 5.6.14
$2y$10$RCY6SzH25duwPVtkMJIifuVZR84AUbQH3R4ueEiPqoZvDwtqHfEKi<br> Password is valid!
Output for 5.6.13
$2y$10$H2gn1dJlt6CeMxvBJJWlJu2zfhKrRJwduGrVBw9oGPCJ0NMjpiqNC<br> Password is valid!
Output for 5.6.12
$2y$10$chFUM747WCrGcWfim0WRO.dw7roCT7v7ZeRI2SgIWAd.yQqdqrICa<br> Password is valid!
Output for 5.6.11
$2y$10$HQFmJsdH3qcjsSlwoHgo/.0.wz/G16Qz3vWWFv59GrKQGtEOw8VmK<br> Password is valid!
Output for 5.6.10
$2y$10$ZrI4MDpnt.SB3TfdPu7PleKMNxr0IJe1ubfR6L1e4UzpRpce30FDu<br> Password is valid!
Output for 5.6.9
$2y$10$n1w4HXCSYDTNLVVkGfXUweK4KMlLrVEst1ETOZR002r1yS32ff8H.<br> Password is valid!
Output for 5.6.8
$2y$10$sMZfoxJg6prBM2pWb9KFFeDjLcTbaQ5eJ9IR3muzVCZoUhI35U55y<br> Password is valid!
Output for 5.5.34
$2y$10$UtjvJzx6nNXaVG1Umd2TlOJUP5f4jvi0k.i30ZxFFWj11sfQZBj8m<br> Password is valid!
Output for 5.5.33
$2y$10$UEsOocmaTEpZkqqsvu32tuIgIWIdJzb.AJ0zpEMal6DLLX8.hJEnu<br> Password is valid!
Output for 5.5.32
$2y$10$Lj9cpePCqWhcqaN7NH2VAupJEpqwzmDlUYCncpOLORvXKo.bUt53K<br> Password is valid!
Output for 5.5.31
$2y$10$h1fVe67RLCEAIXs6UW5vFOqXHvpLVWqMDOKGsP4tKtHtwQtoyDvTW<br> Password is valid!
Output for 5.5.30
$2y$10$ecPjrjoyTU2ON3a.mMo9qePVW0E2BSKjsh09l/QAZL5YqVSmbxbTu<br> Password is valid!
Output for 5.5.29
$2y$10$gvUoaQwA8bqNKiuWB3isQO7z8aJi6eE2Q4bAsJNglVRHD8Fh/2Bpa<br> Password is valid!
Output for 5.5.28
$2y$10$X0oBJ.YGpUiEUstzfiLubuwdheDsMSxs9ZlWVoKSoYPb8scjrbFB6<br> Password is valid!
Output for 5.5.27
$2y$10$02Kybeps1zxJMtVX2UB6Cu5QvDMG/zKnX3FJeoVKQqS3I9hrAxsN2<br> Password is valid!
Output for 5.5.26
$2y$10$dK2Vol7Taig1uBEh/wwyauQEbfKdtkj9/GX/4ZTkx22Sye3HjNzES<br> Password is valid!
Output for 5.5.25
$2y$10$WcFrywy9ySiJqOPK0hTWbe2spLAzpQz0sC7p8Xb/IH.0pMnqWAqUa<br> Password is valid!
Output for 5.5.24
$2y$10$VLpUFr1y/iaY3klnv7gqqepBmXR47MUHffbc.45zr232WBodUfhGa<br> Password is valid!
Output for 5.4.45
Notice: Use of undefined constant PASSWORD_DEFAULT - assumed 'PASSWORD_DEFAULT' in /in/Laqar on line 29 $2y$10$RFyZ2UrLh6lx54TBuSMnpeTfZiKRpZ3KsS/FU1601SiVkK1JsgJT2<br> Password is valid!
Output for 5.4.44
Notice: Use of undefined constant PASSWORD_DEFAULT - assumed 'PASSWORD_DEFAULT' in /in/Laqar on line 29 $2y$10$Hp/wG.xWss1syULKwbE7pOqXMgauX9CXTwIT58nojw4GjHZBpmyb6<br> Password is valid!
Output for 5.4.43
Notice: Use of undefined constant PASSWORD_DEFAULT - assumed 'PASSWORD_DEFAULT' in /in/Laqar on line 29 $2y$10$djUBQg0UwwGKTwhr05xRruHVHkUjZlyJ23dHazzmziABZavmL9xLO<br> Password is valid!
Output for 5.4.42
Notice: Use of undefined constant PASSWORD_DEFAULT - assumed 'PASSWORD_DEFAULT' in /in/Laqar on line 29 $2y$10$F7SItGjGBrszYG5IX/zR3uNGmK1uMy5Ab5annM/PtQUiMFO0b7kIy<br> Password is valid!
Output for 5.4.41
Notice: Use of undefined constant PASSWORD_DEFAULT - assumed 'PASSWORD_DEFAULT' in /in/Laqar on line 29 $2y$10$mneZLOn02a1FjqaJhy2wkeSOsPLvvH9dtsMA30vItZa4ADMXOjZZi<br> Password is valid!
Output for 5.4.40
Notice: Use of undefined constant PASSWORD_DEFAULT - assumed 'PASSWORD_DEFAULT' in /in/Laqar on line 29 $2y$10$wfQbvw.EAcgqodVG235A7Owtp8rKBa271aBbOb3tLa9Qz2TVhuz7O<br> Password is valid!
Output for 5.4.39
Notice: Use of undefined constant PASSWORD_DEFAULT - assumed 'PASSWORD_DEFAULT' in /in/Laqar on line 29 $2y$10$Cx97ocagXs3zFUfyF.YcB.FYKXjTMQB.1oqEgHfkgfLbvtv/i5lC2<br> Password is valid!
Output for 5.4.38
Notice: Use of undefined constant PASSWORD_DEFAULT - assumed 'PASSWORD_DEFAULT' in /in/Laqar on line 29 $2y$10$PXsznTDIvfHtBFukecpj7e3oi4bMNg10k/brFCkVlIrtcEzSqAW2C<br> Password is valid!
Output for 5.4.37
Notice: Use of undefined constant PASSWORD_DEFAULT - assumed 'PASSWORD_DEFAULT' in /in/Laqar on line 29 $2y$10$..DYuI4VV28JQITWfn2IL.oCW6fXB/qzvM/3q.NDW6wqw/TDddABC<br> Password is valid!
Output for 5.4.36
Notice: Use of undefined constant PASSWORD_DEFAULT - assumed 'PASSWORD_DEFAULT' in /in/Laqar on line 29 $2y$10$U6WULayFHzjNUcnyZWRGfetLvAJpO.JnIQMMds9shifFAgBMEMyJC<br> Password is valid!
Output for 5.4.35
Notice: Use of undefined constant PASSWORD_DEFAULT - assumed 'PASSWORD_DEFAULT' in /in/Laqar on line 29 $2y$10$xyMpssRpwcqjeSyyF/ElD.f/MBVA/QLnXTlN9m7fm7wfdo72Jq4VO<br> Password is valid!
Output for 5.4.34
Notice: Use of undefined constant PASSWORD_DEFAULT - assumed 'PASSWORD_DEFAULT' in /in/Laqar on line 29 $2y$10$.j804MlNgBiJx/.hy6WbmOfPVlt4SXycMezsstUDikJqndEEKu7N.<br> Password is valid!
Output for 5.4.32
Notice: Use of undefined constant PASSWORD_DEFAULT - assumed 'PASSWORD_DEFAULT' in /in/Laqar on line 29 $2y$10$mojttb4eaqDtkYnyHi78eu0xPe5fI77hxlaG50Lzjtv3aqcX60ODm<br> Password is valid!
Output for 5.4.31
Notice: Use of undefined constant PASSWORD_DEFAULT - assumed 'PASSWORD_DEFAULT' in /in/Laqar on line 29 $2y$10$BsxtJAKTt/VvMaQpiYtih.t8cmdIK7iMZEIozSf2oEtTNpZ9FmZue<br> Password is valid!
Output for 5.4.30
Notice: Use of undefined constant PASSWORD_DEFAULT - assumed 'PASSWORD_DEFAULT' in /in/Laqar on line 29 $2y$10$rP0h0rV8k3yZxCiKruaG4u9Ra2BpAe/Z3CeeLDN4uiNH0EuEG6OPC<br> Password is valid!
Output for 5.4.29
Notice: Use of undefined constant PASSWORD_DEFAULT - assumed 'PASSWORD_DEFAULT' in /in/Laqar on line 29 $2y$10$GbyXZVPLQkL72yqWMWs85.0Bt0Ty.KcH.nDFLNFkw1gpTb/BpC0O6<br> Password is valid!
Output for 5.4.28
Notice: Use of undefined constant PASSWORD_DEFAULT - assumed 'PASSWORD_DEFAULT' in /in/Laqar on line 29 $2y$10$0l0w0la4b/tduBB3DGCwH.9D.ongKaGj8mMIokQn/8XDVTTaPjL.G<br> Password is valid!
Output for 5.4.27
Notice: Use of undefined constant PASSWORD_DEFAULT - assumed 'PASSWORD_DEFAULT' in /in/Laqar on line 29 $2y$10$CiPLa/X70Re4sWsyJMsnPeSson/76Pf0PcwZPAJJnDT/7M6Vay526<br> Password is valid!
Output for 5.4.26
Notice: Use of undefined constant PASSWORD_DEFAULT - assumed 'PASSWORD_DEFAULT' in /in/Laqar on line 29 $2y$10$MgLjI5rS27doVo87aZFcveGRA6w2wH4BoXvK1Em/871OhT9Ac3aBW<br> Password is valid!
Output for 5.4.25
Notice: Use of undefined constant PASSWORD_DEFAULT - assumed 'PASSWORD_DEFAULT' in /in/Laqar on line 29 $2y$10$97XlbSZkFJKL3VPbL62W8Okh.77S4NTDLgLvRDRNaioybmXzDqbUS<br> Password is valid!
Output for 5.4.24
Notice: Use of undefined constant PASSWORD_DEFAULT - assumed 'PASSWORD_DEFAULT' in /in/Laqar on line 29 $2y$10$x8alraQCWalIlavHapTvTewYGzgSdrCDdxdsntshiP73C0vJqBtY.<br> Password is valid!
Output for 5.4.23
Notice: Use of undefined constant PASSWORD_DEFAULT - assumed 'PASSWORD_DEFAULT' in /in/Laqar on line 29 $2y$10$8.GgptjgPuvPJ0ffMompVOIRAjJV14GwynDfyJFstaCl19WWSaQj.<br> Password is valid!
Output for 5.4.22
Notice: Use of undefined constant PASSWORD_DEFAULT - assumed 'PASSWORD_DEFAULT' in /in/Laqar on line 29 $2y$10$RalyDl.jBsF4mA32fakCtePxv7LUx9adLQa7KqjF36U6uVrYPNCYi<br> Password is valid!
Output for 5.4.21
Notice: Use of undefined constant PASSWORD_DEFAULT - assumed 'PASSWORD_DEFAULT' in /in/Laqar on line 29 $2y$10$RaIT2vcMX9E0wDcxt3V2/ueNWdWqFSqz4aJhaBKj.WGiUtPDM4Sq6<br> Password is valid!
Output for 5.4.20
Notice: Use of undefined constant PASSWORD_DEFAULT - assumed 'PASSWORD_DEFAULT' in /in/Laqar on line 29 $2y$10$.In4cRfwpaZx8rilCNJS5Oz21vOfFPpNI9Ed9DeCEZ.DdNDqZwJZG<br> Password is valid!
Output for 5.4.19
Notice: Use of undefined constant PASSWORD_DEFAULT - assumed 'PASSWORD_DEFAULT' in /in/Laqar on line 29 $2y$10$/Kxk523Mujm/5k1eEn/4M.7JJXtqvwD7u0wOLYJvO.If28lNrK5Ii<br> Password is valid!
Output for 5.4.18
Notice: Use of undefined constant PASSWORD_DEFAULT - assumed 'PASSWORD_DEFAULT' in /in/Laqar on line 29 $2y$10$kWGURwaK0vVFhKAO8nRLHeNJZ9w8oF6RlgTgSkfxiCndWbrZR.Jg6<br> Password is valid!
Output for 5.4.17
Notice: Use of undefined constant PASSWORD_DEFAULT - assumed 'PASSWORD_DEFAULT' in /in/Laqar on line 29 $2y$10$n.EuyVzZeQLgvbOSDOHjnei22Tr4PXP56xFvn7VqhQHNN5RsWfTlG<br> Password is valid!
Output for 5.4.16
Notice: Use of undefined constant PASSWORD_DEFAULT - assumed 'PASSWORD_DEFAULT' in /in/Laqar on line 29 $2y$10$iihKU8z1.2fbQhJg.e5Ij.CJ8GV1B2pnbDtSIVAG5AA8SI8zHyH12<br> Password is valid!
Output for 5.4.15
Notice: Use of undefined constant PASSWORD_DEFAULT - assumed 'PASSWORD_DEFAULT' in /in/Laqar on line 29 $2y$10$l/ieI6c0Hxuuzbsw/DM0d.DnHq3Gu6CHL4r6SBJQ55O2QuNhV0D3y<br> Password is valid!
Output for 5.4.14
Notice: Use of undefined constant PASSWORD_DEFAULT - assumed 'PASSWORD_DEFAULT' in /in/Laqar on line 29 $2y$10$k6VTN04eKhTGIuCdeAnrIeDFF8RINfiFamaHshkOrv6CqRsIAYu8e<br> Password is valid!
Output for 5.4.13
Notice: Use of undefined constant PASSWORD_DEFAULT - assumed 'PASSWORD_DEFAULT' in /in/Laqar on line 29 $2y$10$Z6xoz1U6NF5YjSlxKg9laezDqB4l4mkwsk0kIosqZLw4iCCdptw8a<br> Password is valid!
Output for 5.4.12
Notice: Use of undefined constant PASSWORD_DEFAULT - assumed 'PASSWORD_DEFAULT' in /in/Laqar on line 29 $2y$10$I.lGyokiHk4qg.ZZJocLz.TIOAz4Mgl5TUa8UaRPRumv2ORtCBX4y<br> Password is valid!
Output for 5.4.11
Notice: Use of undefined constant PASSWORD_DEFAULT - assumed 'PASSWORD_DEFAULT' in /in/Laqar on line 29 $2y$10$iui.NJfgLtG8lFGUOTjdY.vNs8OroUA13hsDKMKFTD6fZB2u.PDw2<br> Password is valid!
Output for 5.4.10
Notice: Use of undefined constant PASSWORD_DEFAULT - assumed 'PASSWORD_DEFAULT' in /in/Laqar on line 29 $2y$10$HmScVAY4yAoVCObbYJlZPeszwImxMv/WMQppKMxesA1b3DbiRFhsW<br> Password is valid!
Output for 5.4.9
Notice: Use of undefined constant PASSWORD_DEFAULT - assumed 'PASSWORD_DEFAULT' in /in/Laqar on line 29 $2y$10$IZQc0.KlzRpOVMBzE71qaeqs7j3UxGW4/UZ2K4UEUkZj3o3i59RLe<br> Password is valid!
Output for 5.4.8
Notice: Use of undefined constant PASSWORD_DEFAULT - assumed 'PASSWORD_DEFAULT' in /in/Laqar on line 29 $2y$10$o67DhiZ5qSVx1f5Ceh9TQOZ9Jp73j8b7s7OqP.zs2Aus.Lb8BxCBa<br> Password is valid!
Output for 5.4.7
Notice: Use of undefined constant PASSWORD_DEFAULT - assumed 'PASSWORD_DEFAULT' in /in/Laqar on line 29 $2y$10$iO3vme/UFUBepccf8aCPY.UHze2MPtq5w3i.0UoC2SmYbYqm85CEa<br> Password is valid!
Output for 5.4.6
Notice: Use of undefined constant PASSWORD_DEFAULT - assumed 'PASSWORD_DEFAULT' in /in/Laqar on line 29 $2y$10$kZz52OaD16mzb9WRa1Py2e8ZSr6rqPfXiBiqr6rLbEt3b7krgPwT2<br> Password is valid!
Output for 5.4.5
Notice: Use of undefined constant PASSWORD_DEFAULT - assumed 'PASSWORD_DEFAULT' in /in/Laqar on line 29 $2y$10$I2oMY1KjKrO8cdZBJsjOpOAFofKF524yBb6zjJWtpLn5qsZgSR.d.<br> Password is valid!
Output for 5.4.4
Notice: Use of undefined constant PASSWORD_DEFAULT - assumed 'PASSWORD_DEFAULT' in /in/Laqar on line 29 $2y$10$oAC7ss4FGellAb/CnqfIB.V8fFmC4lW3iS8hkxBPyYTh8ttvEWQj2<br> Password is valid!
Output for 5.4.3
Notice: Use of undefined constant PASSWORD_DEFAULT - assumed 'PASSWORD_DEFAULT' in /in/Laqar on line 29 $2y$10$iQN0Yg8Zgo2pXvmmCAzKj.BxGYlgrvKCtE96izSOD/MOjiO5ZHhXu<br> Password is valid!
Output for 5.4.2
Notice: Use of undefined constant PASSWORD_DEFAULT - assumed 'PASSWORD_DEFAULT' in /in/Laqar on line 29 $2y$10$8ZiecfghS7SB.9kxuY.ek.GBv0tXGa2jTJgfkCCPs9AZwwzzvHB6i<br> Password is valid!
Output for 5.4.1
Notice: Use of undefined constant PASSWORD_DEFAULT - assumed 'PASSWORD_DEFAULT' in /in/Laqar on line 29 $2y$10$ohKmrly7SWrXRy04WECGxORuFXySR1wa7UYTxuF1ZDGFj9Poz.63.<br> Password is valid!
Output for 5.4.0
Notice: Use of undefined constant PASSWORD_DEFAULT - assumed 'PASSWORD_DEFAULT' in /in/Laqar on line 29 $2y$10$Y5uNl5NRRR1JHPBgkWaFL.dqSbLx7edCiHwusoxylyY3Iau4vNfPK<br> Password is valid!
Output for 5.0.0 - 5.3.29
Notice: Use of undefined constant PASSWORD_DEFAULT - assumed 'PASSWORD_DEFAULT' in /in/Laqar on line 29 Fatal error: Call to undefined function mcrypt_create_iv() in /in/Laqar on line 9
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Notice: Use of undefined constant PASSWORD_DEFAULT - assumed 'PASSWORD_DEFAULT' in /in/Laqar on line 29 Fatal error: Call to undefined function: mcrypt_create_iv() in /in/Laqar on line 9
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Notice: Use of undefined constant PASSWORD_DEFAULT - assumed 'PASSWORD_DEFAULT' in /in/Laqar on line 29 Fatal error: Call to undefined function: mcrypt_create_iv() in /in/Laqar on line 9
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Notice: Use of undefined constant PASSWORD_DEFAULT - assumed 'PASSWORD_DEFAULT' in /in/Laqar on line 29 Fatal error: Call to undefined function: mcrypt_create_iv() in /in/Laqar on line 9