3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $password = 'I love Pizza!'; $cost = 10; $salt = strtr(base64_encode(mcrypt_create_iv(16, MCRYPT_DEV_URANDOM)), '+', '.'); $options = array('cost' => $cost,'salt' => $salt); $hash = password_hash($password, PASSWORD_DEFAULT,$options); var_dump(password_verify($password, $hash));
Output for 7.0.6 - 7.2.0
Fatal error: Uncaught Error: Call to undefined function mcrypt_create_iv() in /in/5Oc0n:6 Stack trace: #0 {main} thrown in /in/5Oc0n on line 6
Process exited with code 255.
Output for 7.0.0 - 7.0.5
Deprecated: password_hash(): Use of the 'salt' option to password_hash is deprecated in /in/5Oc0n on line 9 bool(true)
Output for 5.3.19 - 5.3.29, 5.5.35, 5.6.21
Fatal error: Call to undefined function mcrypt_create_iv() in /in/5Oc0n on line 6
Process exited with code 255.
Output for 5.5.24 - 5.5.34, 5.6.8 - 5.6.20
bool(true)
Output for 5.4.0 - 5.4.45
Fatal error: Call to undefined function password_hash() in /in/5Oc0n on line 9
Process exited with code 255.