3v4l.org

run code in 300+ PHP versions simultaneously
<?php $method = 'POST'; $host = 'ic-preprod-za.emeabridge.eu'; $pathInfo = '/api/v2/companies/234441/oauth/quickbooks/button.html'; $content = ''; $time = time(); $replayProtection = true; //$secret = 'ThisTokenIsNotSoSecretChangeItNow'; $secret = 'InExtenSoXeonyS2014OnAir'; $payload = [ $method, $host, $pathInfo, $content, ]; if ($replayProtection === true) { array_unshift($payload, $time); } echo "Time: $time\n"; var_dump($payload); echo hash_hmac('SHA1', implode("\n", $payload), $secret);
Output for 7.1.0 - 7.1.12, 7.2.0
Time: 1512599464 array(5) { [0]=> int(1512599464) [1]=> string(4) "POST" [2]=> string(27) "ic-preprod-za.emeabridge.eu" [3]=> string(53) "/api/v2/companies/234441/oauth/quickbooks/button.html" [4]=> string(0) "" } 7c0c75f72c6e1eb40d19ded271beeb5df273df37

preferences:
46.25 ms | 402 KiB | 19 Q