3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $string = '511.483USD677144616IT Books. Qty: 217Books Online Inc.14www.sample.com1512345678901234589999999919pgw@mail.sample.com11--142003010515302116F2B2DD7E603A7ADA33https://www.sample.com/shop/reply'; $key = pack('H*', '00112233445566778899AABBCCDDEEFF'); $expected = 'FACC882CA67E109E409E3974DDEDA8AAB13A5E48'; $result = hash_hmac('sha1', $string, $key); $result = strtoupper($result); echo "Expected: $expected".PHP_EOL; echo "Actual result: $result".PHP_EOL;
based on GXeQe
Output for 5.1.2 - 7.1.7
Expected: FACC882CA67E109E409E3974DDEDA8AAB13A5E48 Actual result: FACC882CA67E109E409E3974DDEDA8AAB13A5E48
Output for 5.0.0 - 5.1.1
Fatal error: Call to undefined function hash_hmac() in /in/gcvrl on line 7
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: hash_hmac() in /in/gcvrl on line 7
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: hash_hmac() in /in/gcvrl on line 7
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: hash_hmac() in /in/gcvrl on line 7