3v4l.org

run code in 300+ PHP versions simultaneously
<?php // 2 character salt if (CRYPT_STD_DES == 1) { echo "Standard DES: ".crypt('something','st')."\n<br>"; } else { echo "Standard DES not supported.\n<br>"; } // 4 character salt if (CRYPT_EXT_DES == 1) { echo "Extended DES: ".crypt('something','_S4..some')."\n<br>"; } else { echo "Extended DES not supported.\n<br>"; } // 12 character salt starting with $1$ if (CRYPT_MD5 == 1) { echo "MD5: ".crypt('something','$1$somethin$')."\n<br>"; } else { echo "MD5 not supported.\n<br>"; } // Salt starting with $2a$. The two digit cost parameter: 09. 22 characters if (CRYPT_BLOWFISH == 1) { echo "Blowfish: ".crypt('something','$2a$09$anexamplestringforsalt$')."\n<br>"; } else { echo "Blowfish DES not supported.\n<br>"; } // 16 character salt starting with $5$. The default number of rounds is 5000. if (CRYPT_SHA256 == 1) { echo "SHA-256: ".crypt('something','$5$rounds=5000$anexamplestringforsalt$')."\n<br>"; } else { echo "SHA-256 not supported.\n<br>"; } // 16 character salt starting with $5$. The default number of rounds is 5000. if (CRYPT_SHA512 == 1) { echo "SHA-512: ".crypt('something','$6$rounds=5000$anexamplestringforsalt$'); } else { echo "SHA-512 not supported."; } ?>
Output for 5.3.2 - 5.3.6, 5.3.8 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.25, 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Standard DES: stqAdD7zlbByI <br>Extended DES: _S4..someQXidlBpTUu6 <br>MD5: $1$somethin$4NZKrUlY6r7K7.rdEOZ0w. <br>Blowfish: $2a$09$anexamplestringforsaleLouKejcjRlExmf1671qw3Khl49R3dfu <br>SHA-256: $5$rounds=5000$anexamplestringf$KIrctqsxo2wrPg5Ag/hs4jTi4PmoNKQUGWFXlVy9vu9 <br>SHA-512: $6$rounds=5000$anexamplestringf$Oo0skOAdUFXkQxJpwzO05wgRHG0dhuaPBaOU/oNbGpCEKlf/7oVM5wn6AN0w2vwUgA0O24oLzGQpp1XKI6LLQ0
Output for 5.3.7
Standard DES: stqAdD7zlbByI <br>Extended DES: _S4..someQXidlBpTUu6 <br>MD5: $1$somethin <br>Blowfish: $2a$09$anexamplestringforsaleLouKejcjRlExmf1671qw3Khl49R3dfu <br>SHA-256: $5$rounds=5000$anexamplestringf$KIrctqsxo2wrPg5Ag/hs4jTi4PmoNKQUGWFXlVy9vu9 <br>SHA-512: $6$rounds=5000$anexamplestringf$Oo0skOAdUFXkQxJpwzO05wgRHG0dhuaPBaOU/oNbGpCEKlf/7oVM5wn6AN0w2vwUgA0O24oLzGQpp1XKI6LLQ0
Output for 5.3.0 - 5.3.1
Standard DES: stqAdD7zlbByI <br>Extended DES: _S4..someQXidlBpTUu6 <br>MD5: $1$somethin$4NZKrUlY6r7K7.rdEOZ0w. <br>Blowfish: $2a$09$anexamplestringforsaleLouKejcjRlExmf1671qw3Khl49R3dfu <br> Notice: Use of undefined constant CRYPT_SHA256 - assumed 'CRYPT_SHA256' in /in/puq8S on line 44 SHA-256 not supported. <br> Notice: Use of undefined constant CRYPT_SHA512 - assumed 'CRYPT_SHA512' in /in/puq8S on line 53 SHA-512 not supported.
Output for 4.3.0 - 4.3.11, 4.4.0 - 4.4.9, 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17
Standard DES: stqAdD7zlbByI <br>Extended DES not supported. <br>MD5: $1$somethin$4NZKrUlY6r7K7.rdEOZ0w. <br>Blowfish DES not supported. <br> Notice: Use of undefined constant CRYPT_SHA256 - assumed 'CRYPT_SHA256' in /in/puq8S on line 44 SHA-256 not supported. <br> Notice: Use of undefined constant CRYPT_SHA512 - assumed 'CRYPT_SHA512' in /in/puq8S on line 53 SHA-512 not supported.

preferences:
303.86 ms | 403 KiB | 397 Q