3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php echo "Downloading... "; $json = file_get_contents('http://m.vip.com/ajaxapi-classify.html?query=27967&limit=10000'); echo "[O.K.]\n"; $obj = json_decode($json); echo (float)$obj->data[0]->discount; if (file_exists($obj)) { header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename="test.txt"'); header('Expires: 0'); header('Cache-Control: must-revalidate'); header('Pragma: public'); header('Content-Length: ' . filesize($obj)); readfile($obj); exit; } ?>
Output for 7.2.0
Downloading... Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error in /in/K424O on line 3 Warning: file_get_contents(http://m.vip.com/ajaxapi-classify.html?query=27967&limit=10000): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/K424O on line 3 [O.K.] Notice: Trying to get property 'data' of non-object in /in/K424O on line 6 Notice: Trying to get property 'discount' of non-object in /in/K424O on line 6 0
Output for 5.3.21 - 5.4.45, 5.5.33, 5.6.18 - 5.6.19, 7.0.4, 7.0.20, 7.1.5 - 7.1.10
Downloading... Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error in /in/K424O on line 3 Warning: file_get_contents(http://m.vip.com/ajaxapi-classify.html?query=27967&limit=10000): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/K424O on line 3 [O.K.] Notice: Trying to get property of non-object in /in/K424O on line 6 Notice: Trying to get property of non-object in /in/K424O on line 6 0
Output for 5.5.24 - 5.5.32, 5.5.34 - 5.6.17, 5.6.20 - 7.0.3, 7.0.5 - 7.0.6, 7.1.0
Downloading... Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/K424O on line 3 Warning: file_get_contents(http://m.vip.com/ajaxapi-classify.html?query=27967&limit=10000): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/K424O on line 3 [O.K.] Notice: Trying to get property of non-object in /in/K424O on line 6 Notice: Trying to get property of non-object in /in/K424O on line 6 0