3v4l.org

run code in 300+ PHP versions simultaneously
<?php $hash = "0"; for ($i = 1; $i <= 100000; $i++) { if (hash_hmac('crc32', $i, 'mysecretkey') == $hash) { echo 'Found within ' . $i . PHP_EOL; break; } }
Output for 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Fatal error: Uncaught ValueError: hash_hmac(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm in /in/VDHuD:6 Stack trace: #0 /in/VDHuD(6): hash_hmac('crc32', '1', Object(SensitiveParameterValue)) #1 {main} thrown in /in/VDHuD 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/VDHuD:6 Stack trace: #0 /in/VDHuD(6): hash_hmac('crc32', '1', 'mysecretkey') #1 {main} thrown in /in/VDHuD 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: crc32 in /in/VDHuD on line 6 Found within 1
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33
Found within 3897

preferences:
196.5 ms | 402 KiB | 330 Q