3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $params = array( 'appid' => 10647, 'apikey' => '5ce0020a-efa7-1180-2339-b6a6-9800fcff', 'secretkey' => 'QFwpPRp+g7Zdr9p5LwvPlG4WEh7XFJ1WupsO/Uu9GPRXxXqnGoodfERyuOo4', 'timestamp' => 1408522094, ); ksort($params);//对数组键值进行升序排序 $param_uri = http_build_query($params,'','&'); echo $param_uri; echo base64_encode(hash_hmac('sha1', $param_uri, $secretkey));
based on 6ULu5
Output for 5.1.2 - 5.6.28, 7.0.0 - 7.1.0
apikey=5ce0020a-efa7-1180-2339-b6a6-9800fcff&appid=10647&secretkey=QFwpPRp%2Bg7Zdr9p5LwvPlG4WEh7XFJ1WupsO%2FUu9GPRXxXqnGoodfERyuOo4&timestamp=1408522094 Notice: Undefined variable: secretkey in /in/PQ4tJ on line 11 YjI5NzVmMGMzMjQ0MTFhMzFkMTE2MjhiZGIxMmU4MTUwMzZkMzhkMg==
Output for hhvm-3.12.0
apikey=5ce0020a-efa7-1180-2339-b6a6-9800fcff&appid=10647&secretkey=QFwpPRp%2Bg7Zdr9p5LwvPlG4WEh7XFJ1WupsO%2FUu9GPRXxXqnGoodfERyuOo4&timestamp=1408522094 Notice: Undefined variable: secretkey in /in/PQ4tJ on line 11 Fatal error: Uncaught TypeError: Argument 3 passed to hash_init() must be an instance of string, null given in /in/PQ4tJ:11 Stack trace: #0 /in/PQ4tJ(11): hash_hmac() #1 {main}
Process exited with code 255.
Output for hhvm-3.10.0
apikey=5ce0020a-efa7-1180-2339-b6a6-9800fcff&appid=10647&secretkey=QFwpPRp%2Bg7Zdr9p5LwvPlG4WEh7XFJ1WupsO%2FUu9GPRXxXqnGoodfERyuOo4&timestamp=1408522094 Notice: Undefined variable: secretkey in /in/PQ4tJ on line 11 Warning: HMAC requested without a key
Output for 5.0.0 - 5.1.1
Warning: http_build_query() expects at most 2 parameters, 3 given in /in/PQ4tJ on line 9 Fatal error: Call to undefined function hash_hmac() in /in/PQ4tJ on line 11
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: http_build_query() in /in/PQ4tJ on line 9
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: http_build_query() in /in/PQ4tJ on line 9
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: http_build_query() in /in/PQ4tJ on line 9