3v4l.org

run code in 300+ PHP versions simultaneously
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> </head> <body> <?php error_reporting(E_ALL); ini_set('display_errors', 'On'); $json_string = file_get_contents("http://api.wunderground.com/api/b6a5485aadd03b5f/geolookup/conditions/lang:PL/q/Poland/Opole.json"); $parsed_json = json_decode($json_string); $location = $parsed_json->{'location'}->{'city'}; $temp_c = floatval($parsed_json->{'current_observation'}->{'temp_c'}); $weather = $parsed_json->{'current_observation'}->{'weather'}; $feelslike_c = $parsed_json->{'current_observation'}->{'feelslike_c'}; $wind_kph = floatval($parsed_json->{'current_observation'}->{'wind_kph'}); if(1 == $temp_c) { $stopnieSlownie = "stopień"; } elseif( ($temp_c >= 2) && ($temp_c <= 4) ) { $stopnieSlownie = "stopnie"; } else { $stopnieSlownie = "stopni"; } if(1 == $wind_kph) { $kilometrySlownie = "kilometr"; } elseif( ($wind_kph >= 2) && ($wind_kph <= 4) ) { $kilometrySlownie = "kilometry"; } else { $kilometrySlownie = "kilometrów"; } var_dump($temp_c); echo "To jest prognoza dla miejscowości ${location}:<br/>"; echo "Temperatura to " . round($temp_c) . " ${stopnieSlownie}, odczuwalne " . round($feelslike_c) . " ${stopnieSlownie}, jest ${weather} <br/>"; echo "Wiatr wieje z prędkością " . round($wind_kph) . " ${kilometrySlownie} na godzinę.\n"; ?> </body> </html>
Output for 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /in/DnM44 on line 37 Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /in/DnM44 on line 38 Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /in/DnM44 on line 38 Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /in/DnM44 on line 38 Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /in/DnM44 on line 39 <!DOCTYPE html> <html> <head> <meta charset="utf-8"> </head> <body> Warning: file_get_contents(): php_network_getaddresses: getaddrinfo for api.wunderground.com failed: System error in /in/DnM44 on line 11 Warning: file_get_contents(http://api.wunderground.com/api/b6a5485aadd03b5f/geolookup/conditions/lang:PL/q/Poland/Opole.json): Failed to open stream: php_network_getaddresses: getaddrinfo for api.wunderground.com failed: System error in /in/DnM44 on line 11 Warning: Attempt to read property "location" on null in /in/DnM44 on line 13 Warning: Attempt to read property "city" on null in /in/DnM44 on line 13 Warning: Attempt to read property "current_observation" on null in /in/DnM44 on line 14 Warning: Attempt to read property "temp_c" on null in /in/DnM44 on line 14 Warning: Attempt to read property "current_observation" on null in /in/DnM44 on line 15 Warning: Attempt to read property "weather" on null in /in/DnM44 on line 15 Warning: Attempt to read property "current_observation" on null in /in/DnM44 on line 16 Warning: Attempt to read property "feelslike_c" on null in /in/DnM44 on line 16 Warning: Attempt to read property "current_observation" on null in /in/DnM44 on line 17 Warning: Attempt to read property "wind_kph" on null in /in/DnM44 on line 17 float(0) To jest prognoza dla miejscowości :<br/> Deprecated: round(): Passing null to parameter #1 ($num) of type int|float is deprecated in /in/DnM44 on line 38 Temperatura to 0 stopni, odczuwalne 0 stopni, jest <br/>Wiatr wieje z prędkością 0 kilometrów na godzinę. </body> </html>
Output for 8.1.0 - 8.1.28
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> </head> <body> Warning: file_get_contents(): php_network_getaddresses: getaddrinfo for api.wunderground.com failed: System error in /in/DnM44 on line 11 Warning: file_get_contents(http://api.wunderground.com/api/b6a5485aadd03b5f/geolookup/conditions/lang:PL/q/Poland/Opole.json): Failed to open stream: php_network_getaddresses: getaddrinfo for api.wunderground.com failed: System error in /in/DnM44 on line 11 Warning: Attempt to read property "location" on null in /in/DnM44 on line 13 Warning: Attempt to read property "city" on null in /in/DnM44 on line 13 Warning: Attempt to read property "current_observation" on null in /in/DnM44 on line 14 Warning: Attempt to read property "temp_c" on null in /in/DnM44 on line 14 Warning: Attempt to read property "current_observation" on null in /in/DnM44 on line 15 Warning: Attempt to read property "weather" on null in /in/DnM44 on line 15 Warning: Attempt to read property "current_observation" on null in /in/DnM44 on line 16 Warning: Attempt to read property "feelslike_c" on null in /in/DnM44 on line 16 Warning: Attempt to read property "current_observation" on null in /in/DnM44 on line 17 Warning: Attempt to read property "wind_kph" on null in /in/DnM44 on line 17 float(0) To jest prognoza dla miejscowości :<br/> Deprecated: round(): Passing null to parameter #1 ($num) of type int|float is deprecated in /in/DnM44 on line 38 Temperatura to 0 stopni, odczuwalne 0 stopni, jest <br/>Wiatr wieje z prędkością 0 kilometrów na godzinę. </body> </html>
Output for 8.0.13 - 8.0.30
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> </head> <body> Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error in /in/DnM44 on line 11 Warning: file_get_contents(http://api.wunderground.com/api/b6a5485aadd03b5f/geolookup/conditions/lang:PL/q/Poland/Opole.json): Failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/DnM44 on line 11 Warning: Attempt to read property "location" on null in /in/DnM44 on line 13 Warning: Attempt to read property "city" on null in /in/DnM44 on line 13 Warning: Attempt to read property "current_observation" on null in /in/DnM44 on line 14 Warning: Attempt to read property "temp_c" on null in /in/DnM44 on line 14 Warning: Attempt to read property "current_observation" on null in /in/DnM44 on line 15 Warning: Attempt to read property "weather" on null in /in/DnM44 on line 15 Warning: Attempt to read property "current_observation" on null in /in/DnM44 on line 16 Warning: Attempt to read property "feelslike_c" on null in /in/DnM44 on line 16 Warning: Attempt to read property "current_observation" on null in /in/DnM44 on line 17 Warning: Attempt to read property "wind_kph" on null in /in/DnM44 on line 17 float(0) To jest prognoza dla miejscowości :<br/>Temperatura to 0 stopni, odczuwalne 0 stopni, jest <br/>Wiatr wieje z prędkością 0 kilometrów na godzinę. </body> </html>
Output for 8.0.0 - 8.0.12
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> </head> <body> Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /in/DnM44 on line 11 Warning: file_get_contents(http://api.wunderground.com/api/b6a5485aadd03b5f/geolookup/conditions/lang:PL/q/Poland/Opole.json): Failed to open stream: php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /in/DnM44 on line 11 Warning: Attempt to read property "location" on null in /in/DnM44 on line 13 Warning: Attempt to read property "city" on null in /in/DnM44 on line 13 Warning: Attempt to read property "current_observation" on null in /in/DnM44 on line 14 Warning: Attempt to read property "temp_c" on null in /in/DnM44 on line 14 Warning: Attempt to read property "current_observation" on null in /in/DnM44 on line 15 Warning: Attempt to read property "weather" on null in /in/DnM44 on line 15 Warning: Attempt to read property "current_observation" on null in /in/DnM44 on line 16 Warning: Attempt to read property "feelslike_c" on null in /in/DnM44 on line 16 Warning: Attempt to read property "current_observation" on null in /in/DnM44 on line 17 Warning: Attempt to read property "wind_kph" on null in /in/DnM44 on line 17 float(0) To jest prognoza dla miejscowości :<br/>Temperatura to 0 stopni, odczuwalne 0 stopni, jest <br/>Wiatr wieje z prędkością 0 kilometrów na godzinę. </body> </html>
Output for 7.2.0 - 7.2.25, 7.3.0 - 7.3.12, 7.3.32 - 7.3.33, 7.4.0, 7.4.26 - 7.4.33
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> </head> <body> Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error in /in/DnM44 on line 11 Warning: file_get_contents(http://api.wunderground.com/api/b6a5485aadd03b5f/geolookup/conditions/lang:PL/q/Poland/Opole.json): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/DnM44 on line 11 Notice: Trying to get property 'location' of non-object in /in/DnM44 on line 13 Notice: Trying to get property 'city' of non-object in /in/DnM44 on line 13 Notice: Trying to get property 'current_observation' of non-object in /in/DnM44 on line 14 Notice: Trying to get property 'temp_c' of non-object in /in/DnM44 on line 14 Notice: Trying to get property 'current_observation' of non-object in /in/DnM44 on line 15 Notice: Trying to get property 'weather' of non-object in /in/DnM44 on line 15 Notice: Trying to get property 'current_observation' of non-object in /in/DnM44 on line 16 Notice: Trying to get property 'feelslike_c' of non-object in /in/DnM44 on line 16 Notice: Trying to get property 'current_observation' of non-object in /in/DnM44 on line 17 Notice: Trying to get property 'wind_kph' of non-object in /in/DnM44 on line 17 float(0) To jest prognoza dla miejscowości :<br/>Temperatura to 0 stopni, odczuwalne 0 stopni, jest <br/>Wiatr wieje z prędkością 0 kilometrów na godzinę. </body> </html>
Output for 7.2.29 - 7.2.33, 7.3.16 - 7.3.31, 7.4.3 - 7.4.25
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> </head> <body> Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /in/DnM44 on line 11 Warning: file_get_contents(http://api.wunderground.com/api/b6a5485aadd03b5f/geolookup/conditions/lang:PL/q/Poland/Opole.json): failed to open stream: php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /in/DnM44 on line 11 Notice: Trying to get property 'location' of non-object in /in/DnM44 on line 13 Notice: Trying to get property 'city' of non-object in /in/DnM44 on line 13 Notice: Trying to get property 'current_observation' of non-object in /in/DnM44 on line 14 Notice: Trying to get property 'temp_c' of non-object in /in/DnM44 on line 14 Notice: Trying to get property 'current_observation' of non-object in /in/DnM44 on line 15 Notice: Trying to get property 'weather' of non-object in /in/DnM44 on line 15 Notice: Trying to get property 'current_observation' of non-object in /in/DnM44 on line 16 Notice: Trying to get property 'feelslike_c' of non-object in /in/DnM44 on line 16 Notice: Trying to get property 'current_observation' of non-object in /in/DnM44 on line 17 Notice: Trying to get property 'wind_kph' of non-object in /in/DnM44 on line 17 float(0) To jest prognoza dla miejscowości :<br/>Temperatura to 0 stopni, odczuwalne 0 stopni, jest <br/>Wiatr wieje z prędkością 0 kilometrów na godzinę. </body> </html>
Output for 7.0.20, 7.1.5 - 7.1.33
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> </head> <body> Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error in /in/DnM44 on line 11 Warning: file_get_contents(http://api.wunderground.com/api/b6a5485aadd03b5f/geolookup/conditions/lang:PL/q/Poland/Opole.json): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/DnM44 on line 11 Notice: Trying to get property of non-object in /in/DnM44 on line 13 Notice: Trying to get property of non-object in /in/DnM44 on line 13 Notice: Trying to get property of non-object in /in/DnM44 on line 14 Notice: Trying to get property of non-object in /in/DnM44 on line 14 Notice: Trying to get property of non-object in /in/DnM44 on line 15 Notice: Trying to get property of non-object in /in/DnM44 on line 15 Notice: Trying to get property of non-object in /in/DnM44 on line 16 Notice: Trying to get property of non-object in /in/DnM44 on line 16 Notice: Trying to get property of non-object in /in/DnM44 on line 17 Notice: Trying to get property of non-object in /in/DnM44 on line 17 float(0) To jest prognoza dla miejscowości :<br/>Temperatura to 0 stopni, odczuwalne 0 stopni, jest <br/>Wiatr wieje z prędkością 0 kilometrów na godzinę. </body> </html>
Output for 5.2.6 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.28, 7.0.0 - 7.0.14, 7.1.0
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> </head> <body> Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/DnM44 on line 11 Warning: file_get_contents(http://api.wunderground.com/api/b6a5485aadd03b5f/geolookup/conditions/lang:PL/q/Poland/Opole.json): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/DnM44 on line 11 Notice: Trying to get property of non-object in /in/DnM44 on line 13 Notice: Trying to get property of non-object in /in/DnM44 on line 13 Notice: Trying to get property of non-object in /in/DnM44 on line 14 Notice: Trying to get property of non-object in /in/DnM44 on line 14 Notice: Trying to get property of non-object in /in/DnM44 on line 15 Notice: Trying to get property of non-object in /in/DnM44 on line 15 Notice: Trying to get property of non-object in /in/DnM44 on line 16 Notice: Trying to get property of non-object in /in/DnM44 on line 16 Notice: Trying to get property of non-object in /in/DnM44 on line 17 Notice: Trying to get property of non-object in /in/DnM44 on line 17 float(0) To jest prognoza dla miejscowości :<br/>Temperatura to 0 stopni, odczuwalne 0 stopni, jest <br/>Wiatr wieje z prędkością 0 kilometrów na godzinę. </body> </html>
Output for 5.2.0 - 5.2.5
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> </head> <body> Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/DnM44 on line 11 Warning: file_get_contents(http://api.wunderground.com/api/b6a5485aadd03b5f/geolookup/conditions/lang:PL/q/Poland/Opole.json): failed to open stream: Connection refused in /in/DnM44 on line 11 Notice: Trying to get property of non-object in /in/DnM44 on line 13 Notice: Trying to get property of non-object in /in/DnM44 on line 13 Notice: Trying to get property of non-object in /in/DnM44 on line 14 Notice: Trying to get property of non-object in /in/DnM44 on line 14 Notice: Trying to get property of non-object in /in/DnM44 on line 15 Notice: Trying to get property of non-object in /in/DnM44 on line 15 Notice: Trying to get property of non-object in /in/DnM44 on line 16 Notice: Trying to get property of non-object in /in/DnM44 on line 16 Notice: Trying to get property of non-object in /in/DnM44 on line 17 Notice: Trying to get property of non-object in /in/DnM44 on line 17 float(0) To jest prognoza dla miejscowości :<br/>Temperatura to 0 stopni, odczuwalne 0 stopni, jest <br/>Wiatr wieje z prędkością 0 kilometrów na godzinę. </body> </html>
Output for 5.0.3 - 5.0.5, 5.1.0 - 5.1.6
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> </head> <body> Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/DnM44 on line 11 Warning: file_get_contents(http://api.wunderground.com/api/b6a5485aadd03b5f/geolookup/conditions/lang:PL/q/Poland/Opole.json): failed to open stream: Connection refused in /in/DnM44 on line 11 Fatal error: Call to undefined function json_decode() in /in/DnM44 on line 12
Process exited with code 255.
Output for 5.0.1 - 5.0.2
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> </head> <body> Warning: file_get_contents(): php_network_getaddresses: gethostbyname failed in /in/DnM44 on line 11 Warning: file_get_contents(http://api.wunderground.com/api/b6a5485aadd03b5f/geolookup/conditions/lang:PL/q/Poland/Opole.json): failed to open stream: Success in /in/DnM44 on line 11 Fatal error: Call to undefined function json_decode() in /in/DnM44 on line 12
Process exited with code 255.
Output for 5.0.0
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> </head> <body> Warning: file_get_contents(): php_network_getaddresses: gethostbyname failed in /in/DnM44 on line 11 Warning: file_get_contents(http://api.wunderground.com/api/b6a5485aadd03b5f/geolookup/conditions/lang:PL/q/Poland/Opole.json): failed to open stream: Bad file descriptor in /in/DnM44 on line 11 Fatal error: Call to undefined function json_decode() in /in/DnM44 on line 12
Process exited with code 255.
Output for 4.4.5 - 4.4.9
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> </head> <body> Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/DnM44 on line 11 Warning: file_get_contents(http://api.wunderground.com/api/b6a5485aadd03b5f/geolookup/conditions/lang:PL/q/Poland/Opole.json): failed to open stream: Connection refused in /in/DnM44 on line 11 Fatal error: Call to undefined function: json_decode() in /in/DnM44 on line 12
Process exited with code 255.
Output for 4.3.3 - 4.3.4, 4.3.10 - 4.3.11, 4.4.0 - 4.4.4
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> </head> <body> Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/DnM44 on line 11 Warning: file_get_contents(http://api.wunderground.com/api/b6a5485aadd03b5f/geolookup/conditions/lang:PL/q/Poland/Opole.json): failed to open stream: Connection refused in /in/DnM44 on line 11 Fatal error: Call to undefined function: json_decode() in /in/DnM44 on line 12
Process exited with code 255.
Output for 4.3.5 - 4.3.9
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> </head> <body> Warning: file_get_contents(): php_network_getaddresses: gethostbyname failed in /in/DnM44 on line 11 Warning: file_get_contents(http://api.wunderground.com/api/b6a5485aadd03b5f/geolookup/conditions/lang:PL/q/Poland/Opole.json): failed to open stream: Success in /in/DnM44 on line 11 Fatal error: Call to undefined function: json_decode() in /in/DnM44 on line 12
Process exited with code 255.
Output for 4.3.2
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> </head> <body> Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known (is your IPV6 configuration correct? If this error happens all the time, try reconfiguring PHP using --disable-ipv6 option to configure) in /in/DnM44 on line 11 Warning: file_get_contents(http://api.wunderground.com/api/b6a5485aadd03b5f/geolookup/conditions/lang:PL/q/Poland/Opole.json): failed to open stream: Connection refused in /in/DnM44 on line 11 Fatal error: Call to undefined function: json_decode() in /in/DnM44 on line 12
Process exited with code 255.
Output for 4.3.0 - 4.3.1
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> </head> <body>

preferences:
253.46 ms | 401 KiB | 385 Q