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=28339342042'), true); $return = array(); foreach($data['videos'] as $videos){ $filename = $videos['name']; $url = $videos['url']; $type = 'mp4'; $return[] = array( 'file' => $url, 'type' => $type, 'name' => $filename, ); } echo json_encode($return); ?>
based on vApsV
Output for 7.0.20, 7.1.5 - 7.2.0
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error in /in/gb7sf on line 3 Warning: file_get_contents(http://ok.ru/dk?cmd=videoPlayerMetadata&mid=28339342042): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/gb7sf on line 3 Warning: Invalid argument supplied for foreach() in /in/gb7sf on line 5 []
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/gb7sf on line 3 Warning: file_get_contents(http://ok.ru/dk?cmd=videoPlayerMetadata&mid=28339342042): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/gb7sf on line 3 Warning: Invalid argument supplied for foreach() in /in/gb7sf on line 5 []