3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = "meow"; $b = $a . "\0woef"; var_dump( strlen($a), strlen($b), password_hash($a, PASSWORD_BCRYPT, ['salt' => 'boeschrik', 'cost' => 12]), password_hash($b, PASSWORD_BCRYPT, ['salt' => 'boeschrik', 'cost' => 12]) );
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.25, 7.3.0 - 7.3.12, 7.4.0
Deprecated: password_hash(): Use of the 'salt' option to password_hash is deprecated in /in/LlR9N on line 9 Warning: password_hash(): Provided salt is too short: 9 expecting 22 in /in/LlR9N on line 9 Deprecated: password_hash(): Use of the 'salt' option to password_hash is deprecated in /in/LlR9N on line 10 Warning: password_hash(): Provided salt is too short: 9 expecting 22 in /in/LlR9N on line 10 int(4) int(9) NULL NULL
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.40
Warning: password_hash(): Provided salt is too short: 9 expecting 22 in /in/LlR9N on line 9 Warning: password_hash(): Provided salt is too short: 9 expecting 22 in /in/LlR9N on line 10 int(4) int(9) NULL NULL
Output for 5.4.0 - 5.4.45
Fatal error: Call to undefined function password_hash() in /in/LlR9N on line 9
Process exited with code 255.
Output for 5.2.3 - 5.2.17, 5.3.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/LlR9N on line 9
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.1.6, 5.2.0 - 5.2.2
<br /> <b>Parse error</b>: syntax error, unexpected '[' in <b>/in/LlR9N</b> on line <b>9</b><br />
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1, 5.0.0 - 5.0.5
<br /> <b>Parse error</b>: parse error, unexpected '[' in <b>/in/LlR9N</b> on line <b>9</b><br />
Process exited with code 255.
Output for 4.3.2 - 4.3.4
<br /> <b>Parse error</b>: parse error in <b>/in/LlR9N</b> on line <b>9</b><br />
Process exited with code 255.

preferences:
226.55 ms | 401 KiB | 322 Q