3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $date = gmdate('D, d M Y H:i:s \G\M\T'); $account_name = "xyz"; $containername = "abc"; $account_key = "asdf"; $canonicalizedHeaders = "x-ms-date:$date\nx-ms-version:2014-02-14"; $canonicalizedResource = "/$account_name/$containername\ncomp:list\nrestype:container"; $arraysign = array(); $arraysign[] = 'GET'; /*HTTP Verb*/ $arraysign[] = ''; /*Content-Encoding*/ $arraysign[] = ''; /*Content-Language*/ $arraysign[] = ''; /*Content-Length (include value when zero)*/ $arraysign[] = ''; /*Content-MD5*/ $arraysign[] = ''; /*Content-Type*/ $arraysign[] = ''; /*Date*/ $arraysign[] = ''; /*If-Modified-Since */ $arraysign[] = ''; /*If-Match*/ $arraysign[] = ''; /*If-None-Match*/ $arraysign[] = ''; /*If-Unmodified-Since*/ $arraysign[] = ''; /*Range*/ $arraysign[] = $canonicalizedHeaders; /*CanonicalizedHeaders*/ $arraysign[] = $canonicalizedResource; /*CanonicalizedResource*/ $stringtosign = implode("\n", $arraysign); $signature = 'SharedKey'.' '.$account_name.':'.base64_encode(hash_hmac('sha256', $stringtosign, base64_decode($account_key), true)); $endpoint = 'https://'.$account_name.'.blob.core.windows.net'; $url = $endpoint.'/'.$containername.'?restype=container&comp=list'; $headers = [ "x-ms-date:{$date}", 'x-ms-version:2014-02-14', 'Accept:application/json;odata=nometadata', "Authorization:{$signature}" ]; foreach($key in $headers){ echo $key; }
based on isX6Y
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.1.7
Parse error: syntax error, unexpected 'in' (T_STRING) in /in/R1KAR on line 41
Process exited with code 255.
Output for hhvm-3.15.4
Fatal error: Uncaught Error: syntax error, unexpected T_STRING in /in/R1KAR:41 Stack trace: #0 {main}
Process exited with code 255.