3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $stream = 'monstercat'; $url = sprintf('https://api.twitch.tv/api/channels/%s/access_token/', $stream); $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;
based on MHeSd
Output for 5.5.0 - 5.6.30, 7.0.0 - 7.2.0
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error in /in/fV1XQ on line 5 Warning: file_get_contents(https://api.twitch.tv/api/channels/monstercat/access_token/): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/fV1XQ on line 5 http://usher.twitch.tv/api/channel/hls/monstercat.m3u8?player=twitchweb&token=&sig=
Output for hhvm-3.11.1 - 3.17.3
Warning: Failed to open https://api.twitch.tv/api/channels/monstercat/access_token/ (Could not resolve host: api.twitch.tv) in /in/fV1XQ on line 5 Warning: rawurlencode() expects parameter 1 to be string, null given in /in/fV1XQ on line 9 http://usher.twitch.tv/api/channel/hls/monstercat.m3u8?player=twitchweb&token=&sig=
Output for hhvm-3.10.1
Warning: Failed to open https://api.twitch.tv/api/channels/monstercat/access_token/ (Could not resolve host: api.twitch.tv) in /in/fV1XQ on line 5 http://usher.twitch.tv/api/channel/hls/monstercat.m3u8?player=twitchweb&token=&sig=