3v4l.org

run code in 300+ PHP versions simultaneously
<?php $stream = 'skwjr'; $url = sprintf('https://api.twitch.tv/api/channels/' . $stream . '/access_token/'); $page = file_get_contents($url); $json = json_decode($page, true); $token = $json['token']; $sig = $json['sig']; echo 'http://usher.twitch.tv/api/channel/hls/' . $stream . '.m3u8?player=twitchweb&token=' . rawurlencode($token) . '&sig=' . $sig;

preferences:
42.41 ms | 402 KiB | 5 Q