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/Key/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 git.master, git.master_jit, rfc.property-hooks
Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /in/8j3Kd on line 37 Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /in/8j3Kd on line 38 Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /in/8j3Kd on line 38 Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /in/8j3Kd on line 38 Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /in/8j3Kd 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/8j3Kd on line 11 Warning: file_get_contents(http://api.wunderground.com/api/Key/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/8j3Kd on line 11 Warning: Attempt to read property "location" on null in /in/8j3Kd on line 13 Warning: Attempt to read property "city" on null in /in/8j3Kd on line 13 Warning: Attempt to read property "current_observation" on null in /in/8j3Kd on line 14 Warning: Attempt to read property "temp_c" on null in /in/8j3Kd on line 14 Warning: Attempt to read property "current_observation" on null in /in/8j3Kd on line 15 Warning: Attempt to read property "weather" on null in /in/8j3Kd on line 15 Warning: Attempt to read property "current_observation" on null in /in/8j3Kd on line 16 Warning: Attempt to read property "feelslike_c" on null in /in/8j3Kd on line 16 Warning: Attempt to read property "current_observation" on null in /in/8j3Kd on line 17 Warning: Attempt to read property "wind_kph" on null in /in/8j3Kd 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/8j3Kd 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>

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
42.16 ms | 409 KiB | 8 Q