3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function mcrypt_create_iv($len) { $str = ''; for ($i = 0; $i < $len; $i++) { $str .= chr(mt_rand(0, 255)); } return $str; } $options = [ 'cost' => 11, 'salt' => mcrypt_create_iv(16), ]; echo password_hash("rasmuslerdorf", PASSWORD_BCRYPT, $options)."\n";
Output for 7.0.6 - 7.1.0
Deprecated: password_hash(): Use of the 'salt' option to password_hash is deprecated in /in/VJR5O on line 14 Warning: password_hash(): Provided salt is too short: 16 expecting 22 in /in/VJR5O on line 14
Output for 5.5.35 - 5.6.28
Warning: password_hash(): Provided salt is too short: 16 expecting 22 in /in/VJR5O on line 14
Output for 5.4.0 - 5.4.16
Fatal error: Cannot redeclare mcrypt_create_iv() in /in/VJR5O on line 8
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.26
Parse error: syntax error, unexpected '[' in /in/VJR5O on line 10
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[' in /in/VJR5O on line 10
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/VJR5O on line 10
Process exited with code 255.