3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php /** * Note that the salt here is randomly generated. * Never use a static salt or one that is not randomly generated. * * For the VAST majority of use-cases, let password_hash generate the salt randomly for you */ $options = [ 'cost' => 11, 'salt' => mcrypt_create_iv(256, MCRYPT_DEV_URANDOM), ]; $hash = password_hash("rasmuslerdorf", PASSWORD_BCRYPT, $options)."\n"; $verify = password_verify("rasmuslerdorf",$hash); print_r( [ "hash" => $hash, "verify" => $verify ]); ?>
based on fiMOI
Output for 7.0.6 - 7.2.0
Fatal error: Uncaught Error: Call to undefined function mcrypt_create_iv() in /in/qdsgD:10 Stack trace: #0 {main} thrown in /in/qdsgD on line 10
Process exited with code 255.
Output for 7.0.5
Deprecated: password_hash(): Use of the 'salt' option to password_hash is deprecated in /in/qdsgD on line 12 Array ( [hash] => $2y$11$aFRFUsaX/jAIuHNHE14N.eog4Todfuj5ji/9FqlCZ6CpM7Ct9K0Qm [verify] => )
Output for 7.0.4
Deprecated: password_hash(): Use of the 'salt' option to password_hash is deprecated in /in/qdsgD on line 12 Array ( [hash] => $2y$11$yh1LC4K4MzaqmSrzmZxYGOc1xhTPSsUWe.s6Znbz5iebE7NAUx8za [verify] => )
Output for 7.0.3
Deprecated: password_hash(): Use of the 'salt' option to password_hash is deprecated in /in/qdsgD on line 12 Array ( [hash] => $2y$11$kOO3R71C8PKyWg3/s/tK3eI22dwNmdFdPEumzfwOeEJh9U622U0aK [verify] => )
Output for 7.0.2
Deprecated: password_hash(): Use of the 'salt' option to password_hash is deprecated in /in/qdsgD on line 12 Array ( [hash] => $2y$11$1ZS/ZQTBuUWJ2slpkVKyK..gzmryLhVXIXzxZ52FBotvIHfFpb4eO [verify] => )
Output for 7.0.1
Deprecated: password_hash(): Use of the 'salt' option to password_hash is deprecated in /in/qdsgD on line 12 Array ( [hash] => $2y$11$fEEKEC5bv0eus3cMipnQq.OMa0E4mN4yPmO3y730N080tr0OSvDfa [verify] => )
Output for 7.0.0
Deprecated: password_hash(): Use of the 'salt' option to password_hash is deprecated in /in/qdsgD on line 12 Array ( [hash] => $2y$11$Jhrk9ed8Xb.OQbO43sX7OuGH1xkJ5.cR2Fr7rckyjIblPSRWtwXnO [verify] => )
Output for 5.5.35, 5.6.21
Fatal error: Call to undefined function mcrypt_create_iv() in /in/qdsgD on line 10
Process exited with code 255.
Output for 5.6.20
Array ( [hash] => $2y$11$gD42BZ3nTcfoz9eI8y4EAOR0EYCGngI59uuzUq17eVwzDbp6G10U2 [verify] => )
Output for 5.6.19
Array ( [hash] => $2y$11$rwfzL12JDotToF9a9ENbp.T63vFi8JwsI21mh/SFuKqO6qgsWPKnW [verify] => )
Output for 5.6.18
Array ( [hash] => $2y$11$HmRd8NNx11WrcPKnDxVVNe20h2IAFgIpuPhY2t09Uc/J1kfX8aiDi [verify] => )
Output for 5.6.17
Array ( [hash] => $2y$11$pr2LLh05IB0xBPNhD1s3POwGWoMRXM7/9F86YOqtM48Ag2pQp4lz6 [verify] => )
Output for 5.6.16
Array ( [hash] => $2y$11$nH7rbHtJMJeD5TIqqKkVNepOGpiYe/pU6.zS/WDqCb2t5aYs1xmSW [verify] => )
Output for 5.6.15
Array ( [hash] => $2y$11$20KouuFtQMYarwIV3VHIWOwbsXE9JYez/h0RmgzFtOP3NfHsTqOLK [verify] => )
Output for 5.6.14
Array ( [hash] => $2y$11$jLOwOwEy1TekS9SpbwoGkuYKdYNwK8wf6zO6r1.X2VufsW9FCaC6S [verify] => )
Output for 5.6.13
Array ( [hash] => $2y$11$DDvjz.iBVomSN9K9UEm7j.3Q7oe5Sv5b03YKL8j5x.8XlJETRS6Qq [verify] => )
Output for 5.6.12
Array ( [hash] => $2y$11$Bm6NkfJeRmBUwHh44tdAYumoojmyi9B/jDz2hLy2wzAWxtqkyJvEq [verify] => )
Output for 5.6.11
Array ( [hash] => $2y$11$HfjwXxaKkijMoMrFXy/Wke.m/9fnfnS3QofBSltqIabpQ8nZOAO/a [verify] => )
Output for 5.6.10
Array ( [hash] => $2y$11$r7Pa59nnyz3AhiAP78uy3umDE6aqi4A4vhKBFOuXi2QgwG/I7lObi [verify] => )
Output for 5.6.9
Array ( [hash] => $2y$11$9lCaYHomGl3frcHi2kCk6OGbe17z8KOKCcK2EpQ09.U986U8w5hGu [verify] => )
Output for 5.6.8
Array ( [hash] => $2y$11$iv2XgT7wIUZ/L0IZfc09BOKSh5SfmP6JQ962LuXSapIzaOSaWMS2K [verify] => )
Output for 5.5.34
Array ( [hash] => $2y$11$IEUQkTLYHQ49KZIosSjp9.gQR.oQrm5tQCoIbIAZEPZXPY6M64hVm [verify] => )
Output for 5.5.33
Array ( [hash] => $2y$11$vfKuwcAl0ajfi/2BfUQszev7gCeXQgETecRb22rKEe.O412LdKh1. [verify] => )
Output for 5.5.32
Array ( [hash] => $2y$11$khhA3ZtJX9nKOtcnZho77.FOa4TN2XKhIHLWIJ8QCK4tnUJaPl9ZC [verify] => )
Output for 5.5.31
Array ( [hash] => $2y$11$p0xTu/23FR5YVEDJHxuSb.TGETUgCNkIXpG/ichEiuZZd7OPgg.ki [verify] => )
Output for 5.5.30
Array ( [hash] => $2y$11$5P5qJ6/aLb3vwXSnnU6vIe0GtKHOwKXnHG23ePIgUpBZjrY0djiGC [verify] => )
Output for 5.5.29
Array ( [hash] => $2y$11$c.oE3tmrPNWhvtOkvgSBMuHDpKM00dtwda8aTZXtfYUW11fYTjor6 [verify] => )
Output for 5.5.28
Array ( [hash] => $2y$11$7dGfgTWkSq1ZIK3GJkHe8Ok31wykpy8BIr23h8SUHZtSI/6Giu0KW [verify] => )
Output for 5.5.27
Array ( [hash] => $2y$11$oIU/ikSHlj.HsC.r3zVaie6fy6hqg9F8dGGR7TIsaJsihhPBkY1u2 [verify] => )
Output for 5.5.26
Array ( [hash] => $2y$11$Aa8NSfs492ZIC0nXwPJLTeqqcLhemuZ6Iig4SgaLeby3hDyLvOadC [verify] => )
Output for 5.5.25
Array ( [hash] => $2y$11$snPbz9YTeFq3i6.lQ067eOL.9hyc31xb9SljCRgrFDuwu0d8f0IRO [verify] => )
Output for 5.5.24
Array ( [hash] => $2y$11$c6eq..ZxDir.6Akf9MQ2IuWAySyCd/zSthVI/EyTBP037BwbKBHvK [verify] => )
Output for 5.4.8 - 5.4.45
Fatal error: Call to undefined function password_hash() in /in/qdsgD on line 12
Process exited with code 255.
Output for 5.3.18 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/qdsgD on line 8
Process exited with code 255.