3v4l.org

run code in 300+ PHP versions simultaneously
<?php $hash = "0"; for ($i = 1; $i <= 100000; $i++) { if (hash_hmac('joaat', $i, 'mysecretkey') == $hash) { echo 'Found within ' . $i . PHP_EOL; break; } }
Output for 8.2.0 - 8.2.19, 8.3.0 - 8.3.7
Fatal error: Uncaught ValueError: hash_hmac(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm in /in/gYbT1:6 Stack trace: #0 /in/gYbT1(6): hash_hmac('joaat', '1', Object(SensitiveParameterValue)) #1 {main} thrown in /in/gYbT1 on line 6
Process exited with code 255.
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28
Fatal error: Uncaught ValueError: hash_hmac(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm in /in/gYbT1:6 Stack trace: #0 /in/gYbT1(6): hash_hmac('joaat', '1', 'mysecretkey') #1 {main} thrown in /in/gYbT1 on line 6
Process exited with code 255.
Output for 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
Warning: hash_hmac(): Non-cryptographic hashing algorithm: joaat in /in/gYbT1 on line 6 Found within 1
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.33
Found within 497

preferences:
222.28 ms | 402 KiB | 273 Q