3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php // Signature: AAAAAQHO6yf5j7OVAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA== $orig = 'AAAAAQHO6yf5j7OVAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=='; $key = "EwBYAupvBAAUKods63Ys1fGlwiccIFJ+qE1hANsAAYmZfDsiP6o+esL/bT/wQnvyl9+6fOIQeVSMI9hLEbizNze/96KxEgaYXKxgbu5RvKdpcSuYgYRz4AKDgN2Oc0uuCOtOiaaIU85OT1VWVFTtRvBpKoxmWkJbc/fFvpOkkBnjfqbnFtpA45H2ZFEx8R3pc63idZsooF2sIx1s7/wIu6S0erA7O8Tg1+LJ7C1+PdQ3aG+ljqVm6v51NlqBaw+K8tS5LjabHvCxDUagGF2GGckOWQiLUJg/dBIBujVox6KLUaNR2CZfclEEntpcfo7HFC7UktyphdCLePY0Y2lPFQ3+j3T6KqyjEKqyw8fR30j9vYdYg2bhDuN53JvPq10DZgAACC4EtlY/2H4bKAEaZYZM3wCdejzR5z6RaepNNqZkYKCzmtfITQXUWnWkthzbTEDWrVs/FxUUcSXqBkaMm7K47MWl8YwO8d1+NBeTuC8ByouqxYHOy/Op2VdxD5Y4K3Ll+vHVvs4aLfYDpC3vWqM7YUDhrejQefWwbC+yjrLD9xUNYV2HVAZRFU3p4Syg4OlmB68d86iW3U/MUb+op6YHkag0f7KMQJW1RixBpK0ANBaniSz0X1sMnx9rjApKOtTai5qHaWiqXYJ22ozacHpfkyikgRvbpiMG0YHp0YUDZk5pCDQ+PqIpfGlgt8QkvRbWasON4c8u6a21v2K3ZpDyeIM2iWj/B483ZZI06/oByRUNZuMHz10iUdBGo64vAknqRlSq2SK0HuvLlxegYF8sMmuj2WsB"; $post_data = '{ "RelyingParty" : "http://auth.xboxlive.com", "TokenType" : "JWT", "Properties" : { "AuthMethod" : "RPS", "SiteName" : "user.auth.xboxlive.com", "RpsTicket" : "t=' . $key . '", } }'; $binary_signature = ''; print 'orig: ' . $orig . PHP_EOL; print 'sha1: ' . base64_encode(hash_hmac('sha1', $post_data, $key, true)) . PHP_EOL; print 'sha256: ' . base64_encode(hash_hmac('sha256', $post_data, $key, true)) . PHP_EOL; print 'sha512: ' . base64_encode(hash_hmac('sha512', $post_data, $key, true)) . PHP_EOL; print PHP_EOL;
Output for 5.1.2 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
orig: AAAAAQHO6yf5j7OVAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA== sha1: p6Y+bRs//WSCqEP4vVq1ENqIMUw= sha256: Mn32eceBqT3V/mNZS+ZkrBwHHevm4bFSwxhHtPk5u1Y= sha512: 5Zz39ur8/Bv6He8YiB268CPNnhtFJQeU9tc+zMlGdvQ64vL2vnA/u5wp6xn0ISsvD5T0VOdDYTEz3HDP61Mcfw==
Output for 5.0.2 - 5.1.1
orig: AAAAAQHO6yf5j7OVAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA== Fatal error: Call to undefined function hash_hmac() in /in/SL7CO on line 21
Process exited with code 255.
Output for 5.0.0 - 5.0.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/SL7CO on line 20 orig: AAAAAQHO6yf5j7OVAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==PHP_EOL Fatal error: Call to undefined function hash_hmac() in /in/SL7CO on line 21
Process exited with code 255.
Output for 4.4.5 - 4.4.9
orig: AAAAAQHO6yf5j7OVAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA== Fatal error: Call to undefined function: hash_hmac() in /in/SL7CO on line 21
Process exited with code 255.
Output for 4.3.10 - 4.4.4
orig: AAAAAQHO6yf5j7OVAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA== Fatal error: Call to undefined function: hash_hmac() in /in/SL7CO on line 21
Process exited with code 255.
Output for 4.3.2 - 4.3.9
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/SL7CO on line 20 orig: AAAAAQHO6yf5j7OVAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==PHP_EOL Fatal error: Call to undefined function: hash_hmac() in /in/SL7CO on line 21
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/SL7CO on line 20 orig: AAAAAQHO6yf5j7OVAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==PHP_EOL Fatal error: Call to undefined function: hash_hmac() in /in/SL7CO on line 21