3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $cost = 9; do { $cost++; $start = microtime(true); password_hash("test", PASSWORD_BCRYPT, ["cost" => $cost]); $end = microtime(true); } while ($end - $start < 0.1); var_dump($cost);
Output for 5.5.0 - 5.5.8, 5.5.10 - 5.5.12, 5.5.14 - 5.5.21, 5.5.23 - 5.6.3, 5.6.5 - 5.6.15, 5.6.17 - 5.6.19, 5.6.22 - 7.0.4, 7.0.6 - 7.0.7, 7.0.9, 7.0.11, 7.0.14 - 7.1.0
int(11)
Output for 5.5.9, 5.5.13, 5.5.22, 5.6.21, 7.0.5, 7.0.8, 7.0.10, 7.0.12
int(12)
Output for 5.6.4, 5.6.16, 5.6.20
int(10)
Output for 5.4.0 - 5.4.45
Fatal error: Call to undefined function password_hash() in /in/6mjjR on line 6
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/6mjjR on line 6
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/6mjjR on line 6
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/6mjjR on line 6
Process exited with code 255.