3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php // Spoke $key = 'This is the key'; $secret = "TRUSTNO1"; $request = array( 'license' => $key, 'authentication' => hash_hmac('sha256', $key, $secret), ); ?> <?php // Hub $key_index = array( 'This is the key' => 'TRUSTNO1' ); if ($auth = $request['authentication']) { if ($key = $request['license'] && $secret = $key_index[$key]) { $new_hash = hash_hmac('sha256', $key, $secret); if (hash_compare($new_hash, $auth)) { var_dump('Authenticated.'); } else { var_dump('Not authenticated'); } } }
based on CfkQs
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Call to undefined function hash_compare() in /in/828rg:25 Stack trace: #0 {main} thrown in /in/828rg on line 25
Process exited with code 255.
Output for 5.3.18 - 5.6.28
Fatal error: Call to undefined function hash_compare() in /in/828rg on line 25
Process exited with code 255.