3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo "<table><tr><th>Monitor Name</th><th>Status</th><th>Total Uptime</th></tr>"; $apiKey = "m776097161-b38ad92f08eaf38909272bdd"; $url = "http://api.uptimerobot.com/getMonitors?apiKey=" . $apiKey . "&format=xml"; $xml = file_get_contents($url); $xml = new SimpleXMLElement ($xml); foreach($xml->monitor as $monitor) { echo "<tr>"; echo "<td>"; echo $monitor['friendlyname']; echo "</td><td>"; if ($monitor['status'] == 2) { echo "Online"; } elseif ($monitor['status'] == 9) { echo "Offline"; } else { echo "Not Available"; } echo "</td><td>"; if ($monitor['alltimeuptimeratio'] > 95) { echo "<b style=\"color:green;\">" . $monitor['alltimeuptimeratio'] . "%</b></td></tr>"; } else { echo "<b style=\"color:red;\">" . $monitor['alltimeuptimeratio'] . "%</b></td></tr>"; } } echo "</table>"; ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 15, Position 2 = 46
Branch analysis from position: 15
2 jumps found. (Code = 78) Position 1 = 16, Position 2 = 46
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 26
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
2 jumps found. (Code = 43) Position 1 = 36, Position 2 = 41
Branch analysis from position: 36
1 jumps found. (Code = 42) Position 1 = 45
Branch analysis from position: 45
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 41
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 26
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 31
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
Branch analysis from position: 31
2 jumps found. (Code = 43) Position 1 = 36, Position 2 = 41
Branch analysis from position: 36
Branch analysis from position: 41
Branch analysis from position: 46
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 46
filename:       /in/CpYqQ
function name:  (null)
number of ops:  49
compiled vars:  !0 = $apiKey, !1 = $url, !2 = $xml, !3 = $monitor
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ECHO                                                     '%3Ctable%3E%3Ctr%3E%3Cth%3EMonitor+Name%3C%2Fth%3E%3Cth%3EStatus%3C%2Fth%3E%3Cth%3ETotal+Uptime%3C%2Fth%3E%3C%2Ftr%3E'
    3     1        ASSIGN                                                   !0, 'm776097161-b38ad92f08eaf38909272bdd'
    4     2        CONCAT                                           ~5      'http%3A%2F%2Fapi.uptimerobot.com%2FgetMonitors%3FapiKey%3D', !0
          3        CONCAT                                           ~6      ~5, '%26format%3Dxml'
          4        ASSIGN                                                   !1, ~6
    5     5        INIT_FCALL                                               'file_get_contents'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                         $8      
          8        ASSIGN                                                   !2, $8
    6     9        NEW                                              $10     'SimpleXMLElement'
         10        SEND_VAR_EX                                              !2
         11        DO_FCALL                                      0          
         12        ASSIGN                                                   !2, $10
    7    13        FETCH_OBJ_R                                      ~13     !2, 'monitor'
         14      > FE_RESET_R                                       $14     ~13, ->46
         15    > > FE_FETCH_R                                               $14, !3, ->46
    8    16    >   ECHO                                                     '%3Ctr%3E'
    9    17        ECHO                                                     '%3Ctd%3E'
   10    18        FETCH_DIM_R                                      ~15     !3, 'friendlyname'
         19        ECHO                                                     ~15
   11    20        ECHO                                                     '%3C%2Ftd%3E%3Ctd%3E'
   12    21        FETCH_DIM_R                                      ~16     !3, 'status'
         22        IS_EQUAL                                                 ~16, 2
         23      > JMPZ                                                     ~17, ->26
   13    24    >   ECHO                                                     'Online'
         25      > JMP                                                      ->32
   15    26    >   FETCH_DIM_R                                      ~18     !3, 'status'
         27        IS_EQUAL                                                 ~18, 9
         28      > JMPZ                                                     ~19, ->31
   16    29    >   ECHO                                                     'Offline'
         30      > JMP                                                      ->32
   19    31    >   ECHO                                                     'Not+Available'
   21    32    >   ECHO                                                     '%3C%2Ftd%3E%3Ctd%3E'
   22    33        FETCH_DIM_R                                      ~20     !3, 'alltimeuptimeratio'
         34        IS_SMALLER                                               95, ~20
         35      > JMPZ                                                     ~21, ->41
   23    36    >   FETCH_DIM_R                                      ~22     !3, 'alltimeuptimeratio'
         37        CONCAT                                           ~23     '%3Cb+style%3D%22color%3Agreen%3B%22%3E', ~22
         38        CONCAT                                           ~24     ~23, '%25%3C%2Fb%3E%3C%2Ftd%3E%3C%2Ftr%3E'
         39        ECHO                                                     ~24
         40      > JMP                                                      ->45
   26    41    >   FETCH_DIM_R                                      ~25     !3, 'alltimeuptimeratio'
         42        CONCAT                                           ~26     '%3Cb+style%3D%22color%3Ared%3B%22%3E', ~25
         43        CONCAT                                           ~27     ~26, '%25%3C%2Fb%3E%3C%2Ftd%3E%3C%2Ftr%3E'
         44        ECHO                                                     ~27
    7    45    > > JMP                                                      ->15
         46    >   FE_FREE                                                  $14
   29    47        ECHO                                                     '%3C%2Ftable%3E'
   30    48      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.83 ms | 1405 KiB | 15 Q