3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function signRequest($domain, $method, $public_key, $private_key, $data=array()){ $data = array_filter($data); // Normalise data if(array_key_exists('request_timestamp', $data)) { $data['request_timestamp'] = (int) $data['request_timestamp']; } ksort($data); $data = json_encode($data); $buffer = array($domain, $method, $data, $public_key); $buffer_str = implode(":", $buffer); return hash_hmac('sha256', $buffer_str, $private_key); } //echo signRequest("neom.dev", "products", "c7912e9a71d7208f", "767f791f93a272d3f4554116", []); echo time();
based on h7VFo
Output for 5.6.0 - 5.6.30, hhvm-3.18.4 - 3.20.2, 7.0.0 - 7.3.0beta1
1504708333
Output for hhvm-3.21.0
1504708334