3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $message = 'Message'; $secret = 'secret'; $hash1 = hash_hmac('sha256', $message, $secret, true); $encoded1 = base64_encode($hash1); //$hash2 = base64_decode($encoded1); $hash2 = hash_hmac('sha256', $message, $secret, true); $encoded2 = base64_encode($hash2); var_dump(hash_equals($encoded1, $encoded2));
based on 9meC9
Output for 5.6.8 - 7.2.6
bool(true)
Output for 5.1.2 - 5.5.35
Fatal error: Call to undefined function hash_equals() in /in/kHKLl on line 13
Process exited with code 255.
Output for 5.0.0 - 5.1.1
Fatal error: Call to undefined function hash_hmac() in /in/kHKLl on line 5
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: hash_hmac() in /in/kHKLl on line 5
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: hash_hmac() in /in/kHKLl on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: hash_hmac() in /in/kHKLl on line 5