3v4l.org

run code in 300+ PHP versions simultaneously
<?php //Title of this code //php 5.5.12 $start = time(); $expire = time() + 2592000; $proto = 'http://'; $domain = 't2-btsport-live-hls-prod.akamaized.net'; $path = 'out/u/europe/europe.m3u8'; $key = 'A65A28D4A2F97F470624F15E637C205D'; $params = 'ip=2.31.243.204~st='.$start.'~exp='.$expire.'~acl=/*'; //WITH IP //$params = 'st='.$start.'~exp='.$expire.'~acl=/*'; //NO IP function h2b($str) { $bin = ""; $i = 0; do { $bin .= chr(hexdec($str{$i}.$str{($i + 1)})); $i += 2; } while ($i < strlen($str)); return $bin; } $hash = hash_hmac('SHA256', $params, h2b($key)); echo $proto.$domain.'/'.$path.'?hdnea='.$params.'~hmac='.$hash; ?>
Output for 7.4.0
Deprecated: Array and string offset access syntax with curly braces is deprecated in /in/2OhHE on line 18 Deprecated: Array and string offset access syntax with curly braces is deprecated in /in/2OhHE on line 18 http://t2-btsport-live-hls-prod.akamaized.net/out/u/europe/europe.m3u8?hdnea=ip=2.31.243.204~st=1470553295~exp=1473145295~acl=/*~hmac=bf587f7d02b9131cacb2945947517ca6a7725524da63a8aa2c98dae20be77063
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.25, 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.6 - 7.2.25, 7.3.0 - 7.3.12
http://t2-btsport-live-hls-prod.akamaized.net/out/u/europe/europe.m3u8?hdnea=ip=2.31.243.204~st=1470553295~exp=1473145295~acl=/*~hmac=bf587f7d02b9131cacb2945947517ca6a7725524da63a8aa2c98dae20be77063

preferences:
108.12 ms | 403 KiB | 118 Q