3v4l.org

run code in 300+ PHP versions simultaneously
<?php $filename = "Temperature"; header("Content-type: application/vnd.ms-excel"); header( "Content-disposition: filename=".$filename.".csv"); print "location, weather, obs_time, latitude, longitude, temp_f, wind_d, wind_deg, wind_mph"; print"\r\n"; $xml = simplexml_load_file('http://w1.weather.gov/xml/current_obs/KCHA.xml'); $loca=$xml->location; $weat=$xml->weather; $obs_time=$xml->observation_time; $lat=$xml->latitude; $long=$xml->longitude; $temp=$xml->temp_f; $wind_d=$xml->wind_dir; $wind_deg=$xml->wind_degrees; $wind_m=$xml->wind_mph; print "\"".$loca."\","; print "\"".$weat."\","; print "\"".$obs_time."\","; print "\"".$lat."\","; print "\"".$long."\","; print "\"".$temp."\","; print "\"".$wind_d."\","; print "\"".$wind_deg."\","; print "\"".$wind_m."\","; print"\r\n"; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Iu9Wn
function name:  (null)
number of ops:  62
compiled vars:  !0 = $filename, !1 = $xml, !2 = $loca, !3 = $weat, !4 = $obs_time, !5 = $lat, !6 = $long, !7 = $temp, !8 = $wind_d, !9 = $wind_deg, !10 = $wind_m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'Temperature'
    4     1        INIT_FCALL                                               'header'
          2        SEND_VAL                                                 'Content-type%3A+application%2Fvnd.ms-excel'
          3        DO_ICALL                                                 
    5     4        INIT_FCALL                                               'header'
          5        CONCAT                                           ~13     'Content-disposition%3A+filename%3D', !0
          6        CONCAT                                           ~14     ~13, '.csv'
          7        SEND_VAL                                                 ~14
          8        DO_ICALL                                                 
    8     9        ECHO                                                     'location%2C+weather%2C+obs_time%2C+latitude%2C+longitude%2C+temp_f%2C+wind_d%2C+wind_deg%2C+wind_mph'
   10    10        ECHO                                                     '%0D%0A'
   11    11        INIT_FCALL                                               'simplexml_load_file'
         12        SEND_VAL                                                 'http%3A%2F%2Fw1.weather.gov%2Fxml%2Fcurrent_obs%2FKCHA.xml'
         13        DO_ICALL                                         $16     
         14        ASSIGN                                                   !1, $16
   12    15        FETCH_OBJ_R                                      ~18     !1, 'location'
         16        ASSIGN                                                   !2, ~18
   13    17        FETCH_OBJ_R                                      ~20     !1, 'weather'
         18        ASSIGN                                                   !3, ~20
   14    19        FETCH_OBJ_R                                      ~22     !1, 'observation_time'
         20        ASSIGN                                                   !4, ~22
   15    21        FETCH_OBJ_R                                      ~24     !1, 'latitude'
         22        ASSIGN                                                   !5, ~24
   16    23        FETCH_OBJ_R                                      ~26     !1, 'longitude'
         24        ASSIGN                                                   !6, ~26
   17    25        FETCH_OBJ_R                                      ~28     !1, 'temp_f'
         26        ASSIGN                                                   !7, ~28
   18    27        FETCH_OBJ_R                                      ~30     !1, 'wind_dir'
         28        ASSIGN                                                   !8, ~30
   19    29        FETCH_OBJ_R                                      ~32     !1, 'wind_degrees'
         30        ASSIGN                                                   !9, ~32
   20    31        FETCH_OBJ_R                                      ~34     !1, 'wind_mph'
         32        ASSIGN                                                   !10, ~34
   21    33        CONCAT                                           ~36     '%22', !2
         34        CONCAT                                           ~37     ~36, '%22%2C'
         35        ECHO                                                     ~37
   22    36        CONCAT                                           ~38     '%22', !3
         37        CONCAT                                           ~39     ~38, '%22%2C'
         38        ECHO                                                     ~39
   23    39        CONCAT                                           ~40     '%22', !4
         40        CONCAT                                           ~41     ~40, '%22%2C'
         41        ECHO                                                     ~41
   24    42        CONCAT                                           ~42     '%22', !5
         43        CONCAT                                           ~43     ~42, '%22%2C'
         44        ECHO                                                     ~43
   25    45        CONCAT                                           ~44     '%22', !6
         46        CONCAT                                           ~45     ~44, '%22%2C'
         47        ECHO                                                     ~45
   26    48        CONCAT                                           ~46     '%22', !7
         49        CONCAT                                           ~47     ~46, '%22%2C'
         50        ECHO                                                     ~47
   27    51        CONCAT                                           ~48     '%22', !8
         52        CONCAT                                           ~49     ~48, '%22%2C'
         53        ECHO                                                     ~49
   28    54        CONCAT                                           ~50     '%22', !9
         55        CONCAT                                           ~51     ~50, '%22%2C'
         56        ECHO                                                     ~51
   29    57        CONCAT                                           ~52     '%22', !10
         58        CONCAT                                           ~53     ~52, '%22%2C'
         59        ECHO                                                     ~53
   30    60        ECHO                                                     '%0D%0A'
   33    61      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.29 ms | 1403 KiB | 17 Q