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>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 35, Position 2 = 37
Branch analysis from position: 35
1 jumps found. (Code = 42) Position 1 = 45
Branch analysis from position: 45
2 jumps found. (Code = 43) Position 1 = 47, Position 2 = 49
Branch analysis from position: 47
1 jumps found. (Code = 42) Position 1 = 57
Branch analysis from position: 57
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 49
2 jumps found. (Code = 46) Position 1 = 51, Position 2 = 53
Branch analysis from position: 51
2 jumps found. (Code = 43) Position 1 = 54, Position 2 = 56
Branch analysis from position: 54
1 jumps found. (Code = 42) Position 1 = 57
Branch analysis from position: 57
Branch analysis from position: 56
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 53
Branch analysis from position: 37
2 jumps found. (Code = 46) Position 1 = 39, Position 2 = 41
Branch analysis from position: 39
2 jumps found. (Code = 43) Position 1 = 42, Position 2 = 44
Branch analysis from position: 42
1 jumps found. (Code = 42) Position 1 = 45
Branch analysis from position: 45
Branch analysis from position: 44
2 jumps found. (Code = 43) Position 1 = 47, Position 2 = 49
Branch analysis from position: 47
Branch analysis from position: 49
Branch analysis from position: 41
filename:       /in/DnM44
function name:  (null)
number of ops:  94
compiled vars:  !0 = $json_string, !1 = $parsed_json, !2 = $location, !3 = $temp_c, !4 = $weather, !5 = $feelslike_c, !6 = $wind_kph, !7 = $stopnieSlownie, !8 = $kilometrySlownie
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    1     0  E >   ECHO                                                     '%3C%21DOCTYPE+html%3E%0A%3Chtml%3E%0A%3Chead%3E%0A%3Cmeta+charset%3D%22utf-8%22%3E%0A%3C%2Fhead%3E%0A%3Cbody%3E%0A'
    8     1        INIT_FCALL                                               'error_reporting'
          2        SEND_VAL                                                 32767
          3        DO_ICALL                                                 
    9     4        INIT_FCALL                                               'ini_set'
          5        SEND_VAL                                                 'display_errors'
          6        SEND_VAL                                                 'On'
          7        DO_ICALL                                                 
   11     8        INIT_FCALL                                               'file_get_contents'
          9        SEND_VAL                                                 'http%3A%2F%2Fapi.wunderground.com%2Fapi%2Fb6a5485aadd03b5f%2Fgeolookup%2Fconditions%2Flang%3APL%2Fq%2FPoland%2FOpole.json'
         10        DO_ICALL                                         $11     
         11        ASSIGN                                                   !0, $11
   12    12        INIT_FCALL                                               'json_decode'
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                         $13     
         15        ASSIGN                                                   !1, $13
   13    16        FETCH_OBJ_R                                      ~15     !1, 'location'
         17        FETCH_OBJ_R                                      ~16     ~15, 'city'
         18        ASSIGN                                                   !2, ~16
   14    19        FETCH_OBJ_R                                      ~18     !1, 'current_observation'
         20        FETCH_OBJ_R                                      ~19     ~18, 'temp_c'
         21        CAST                                          5  ~20     ~19
         22        ASSIGN                                                   !3, ~20
   15    23        FETCH_OBJ_R                                      ~22     !1, 'current_observation'
         24        FETCH_OBJ_R                                      ~23     ~22, 'weather'
         25        ASSIGN                                                   !4, ~23
   16    26        FETCH_OBJ_R                                      ~25     !1, 'current_observation'
         27        FETCH_OBJ_R                                      ~26     ~25, 'feelslike_c'
         28        ASSIGN                                                   !5, ~26
   17    29        FETCH_OBJ_R                                      ~28     !1, 'current_observation'
         30        FETCH_OBJ_R                                      ~29     ~28, 'wind_kph'
         31        CAST                                          5  ~30     ~29
         32        ASSIGN                                                   !6, ~30
   18    33        IS_EQUAL                                                 !3, 1
         34      > JMPZ                                                     ~32, ->37
   19    35    >   ASSIGN                                                   !7, 'stopie%C5%84'
         36      > JMP                                                      ->45
   21    37    >   IS_SMALLER_OR_EQUAL                              ~34     2, !3
         38      > JMPZ_EX                                          ~34     ~34, ->41
         39    >   IS_SMALLER_OR_EQUAL                              ~35     !3, 4
         40        BOOL                                             ~34     ~35
         41    > > JMPZ                                                     ~34, ->44
   22    42    >   ASSIGN                                                   !7, 'stopnie'
         43      > JMP                                                      ->45
   25    44    >   ASSIGN                                                   !7, 'stopni'
   27    45    >   IS_EQUAL                                                 !6, 1
         46      > JMPZ                                                     ~38, ->49
   28    47    >   ASSIGN                                                   !8, 'kilometr'
         48      > JMP                                                      ->57
   30    49    >   IS_SMALLER_OR_EQUAL                              ~40     2, !6
         50      > JMPZ_EX                                          ~40     ~40, ->53
         51    >   IS_SMALLER_OR_EQUAL                              ~41     !6, 4
         52        BOOL                                             ~40     ~41
         53    > > JMPZ                                                     ~40, ->56
   31    54    >   ASSIGN                                                   !8, 'kilometry'
         55      > JMP                                                      ->57
   34    56    >   ASSIGN                                                   !8, 'kilometr%C3%B3w'
   36    57    >   INIT_FCALL                                               'var_dump'
         58        SEND_VAR                                                 !3
         59        DO_ICALL                                                 
   37    60        ROPE_INIT                                     3  ~46     'To+jest+prognoza+dla+miejscowo%C5%9Bci+'
         61        ROPE_ADD                                      1  ~46     ~46, !2
         62        ROPE_END                                      2  ~45     ~46, '%3A%3Cbr%2F%3E'
         63        ECHO                                                     ~45
   38    64        INIT_FCALL                                               'round'
         65        SEND_VAR                                                 !3
         66        DO_ICALL                                         $48     
         67        CONCAT                                           ~49     'Temperatura+to+', $48
         68        ROPE_INIT                                     3  ~51     '+'
         69        ROPE_ADD                                      1  ~51     ~51, !7
         70        ROPE_END                                      2  ~50     ~51, '%2C+odczuwalne+'
         71        CONCAT                                           ~53     ~49, ~50
         72        INIT_FCALL                                               'round'
         73        SEND_VAR                                                 !5
         74        DO_ICALL                                         $54     
         75        CONCAT                                           ~55     ~53, $54
         76        ROPE_INIT                                     5  ~57     '+'
         77        ROPE_ADD                                      1  ~57     ~57, !7
         78        ROPE_ADD                                      2  ~57     ~57, '%2C+jest+'
         79        ROPE_ADD                                      3  ~57     ~57, !4
         80        ROPE_END                                      4  ~56     ~57, '+%3Cbr%2F%3E'
         81        CONCAT                                           ~60     ~55, ~56
         82        ECHO                                                     ~60
   39    83        INIT_FCALL                                               'round'
         84        SEND_VAR                                                 !6
         85        DO_ICALL                                         $61     
         86        CONCAT                                           ~62     'Wiatr+wieje+z+pr%C4%99dko%C5%9Bci%C4%85+', $61
         87        ROPE_INIT                                     3  ~64     '+'
         88        ROPE_ADD                                      1  ~64     ~64, !8
         89        ROPE_END                                      2  ~63     ~64, '+na+godzin%C4%99.%0A'
         90        CONCAT                                           ~66     ~62, ~63
         91        ECHO                                                     ~66
   42    92        ECHO                                                     '%3C%2Fbody%3E%0A%3C%2Fhtml%3E'
   43    93      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.79 ms | 1404 KiB | 25 Q