3v4l.org

run code in 300+ PHP versions simultaneously
<?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 8.3.0 - 8.3.6
Downloading... Warning: file_get_contents(): php_network_getaddresses: getaddrinfo for m.vip.com 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 for m.vip.com failed: System error in /in/K424O on line 3 [O.K.] Warning: Attempt to read property "data" on null in /in/K424O on line 6 Warning: Trying to access array offset on null in /in/K424O on line 6 Warning: Attempt to read property "discount" on null in /in/K424O on line 6 0 Deprecated: file_exists(): Passing null to parameter #1 ($filename) of type string is deprecated in /in/K424O on line 9
Output for 8.1.0 - 8.1.28, 8.2.0 - 8.2.18
Downloading... Warning: file_get_contents(): php_network_getaddresses: getaddrinfo for m.vip.com 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 for m.vip.com failed: System error in /in/K424O on line 3 [O.K.] Warning: Attempt to read property "data" on null in /in/K424O on line 6 Warning: Trying to access array offset on value of type null in /in/K424O on line 6 Warning: Attempt to read property "discount" on null in /in/K424O on line 6 0 Deprecated: file_exists(): Passing null to parameter #1 ($filename) of type string is deprecated in /in/K424O on line 9
Output for 8.0.0 - 8.0.30
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.] Warning: Attempt to read property "data" on null in /in/K424O on line 6 Warning: Trying to access array offset on value of type null in /in/K424O on line 6 Warning: Attempt to read property "discount" on null in /in/K424O on line 6 0
Output for 7.4.26 - 7.4.33
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 access array offset on value of type null 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.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.34, 7.3.0 - 7.3.33, 7.4.0 - 7.4.25
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.] 0

preferences:
219.46 ms | 403 KiB | 339 Q