3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $data = json_decode(file_get_contents('http://ok.ru/dk?cmd=videoPlayerMetadata&mid=31771331179'), true); $return = array(); foreach($data['videos'] as $videos){ $filename = $videos['name']; $url = $videos['url']; $type = 'mp4'; $return[] = array( 'file' => $url, 'type' => $type, 'label' => $filename, ); } echo json_encode($return); ?>
Output for 7.0.20, 7.1.5 - 7.2.0
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error in /in/82A3n on line 2 Warning: file_get_contents(http://ok.ru/dk?cmd=videoPlayerMetadata&mid=31771331179): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/82A3n on line 2 Warning: Invalid argument supplied for foreach() in /in/82A3n on line 4 []
Output for 5.4.0 - 7.0.9, 7.1.0
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/82A3n on line 2 Warning: file_get_contents(http://ok.ru/dk?cmd=videoPlayerMetadata&mid=31771331179): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/82A3n on line 2 Warning: Invalid argument supplied for foreach() in /in/82A3n on line 4 []