3v4l.org

run code in 300+ PHP versions simultaneously
<?php $hashes = []; $previous = null; for ($i = 1; $i <= 100; $i++) { $hashes[$i] = password_hash(str_repeat('a', 1), ['cost' = 4]); if ($previous === $hashes[$i]) { echo '$i = ' . $i . PHP_EOL; break; } $previous = $hashes[$i]; }
Output for 5.4.0 - 5.4.28
Parse error: syntax error, unexpected '=', expecting ']' in /in/vcYLb on line 7
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected '[' in /in/vcYLb on line 3
Process exited with code 255.

preferences:
201.27 ms | 1395 KiB | 65 Q