3v4l.org

run code in 300+ PHP versions simultaneously
<?php $station = "KORD";// Enter your airport's code here. $metarwx = "http://weather.noaa.gov/pub/data/observations/metar/stations/$station.TXT"; $metars = file_get_contents($metarwx); $metar = getCloud($metars); echo $metar; function getCloud($wxReport) { $clouds = ['BKN', 'CAVOK', 'CLR', 'FEW', 'NSC', 'OVC', 'SCT', 'SKC', 'VV']; $wxReportArray = explode(' ', $wxReport); foreach($wxReportArray as $rptPart){ $rptPart = preg_replace('/[0-9]+/', '', $rptPart); if(in_array($rptPart, $clouds)){ return $rptPart; } } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nuJD7
function name:  (null)
number of ops:  15
compiled vars:  !0 = $station, !1 = $metarwx, !2 = $metars, !3 = $metar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'KORD'
    3     1        ROPE_INIT                                     3  ~6      'http%3A%2F%2Fweather.noaa.gov%2Fpub%2Fdata%2Fobservations%2Fmetar%2Fstations%2F'
          2        ROPE_ADD                                      1  ~6      ~6, !0
          3        ROPE_END                                      2  ~5      ~6, '.TXT'
          4        ASSIGN                                                   !1, ~5
    4     5        INIT_FCALL                                               'file_get_contents'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                         $9      
          8        ASSIGN                                                   !2, $9
    5     9        INIT_FCALL_BY_NAME                                       'getCloud'
         10        SEND_VAR_EX                                              !2
         11        DO_FCALL                                      0  $11     
         12        ASSIGN                                                   !3, $11
    6    13        ECHO                                                     !3
   19    14      > RETURN                                                   1

Function getcloud:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 23
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 23
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 22
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
filename:       /in/nuJD7
function name:  getCloud
number of ops:  25
compiled vars:  !0 = $wxReport, !1 = $clouds, !2 = $wxReportArray, !3 = $rptPart
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
   10     1        ASSIGN                                                   !1, <array>
   11     2        INIT_FCALL                                               'explode'
          3        SEND_VAL                                                 '+'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $5      
          6        ASSIGN                                                   !2, $5
   13     7      > FE_RESET_R                                       $7      !2, ->23
          8    > > FE_FETCH_R                                               $7, !3, ->23
   14     9    >   INIT_FCALL                                               'preg_replace'
         10        SEND_VAL                                                 '%2F%5B0-9%5D%2B%2F'
         11        SEND_VAL                                                 ''
         12        SEND_VAR                                                 !3
         13        DO_ICALL                                         $8      
         14        ASSIGN                                                   !3, $8
   15    15        INIT_FCALL                                               'in_array'
         16        SEND_VAR                                                 !3
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                         $10     
         19      > JMPZ                                                     $10, ->22
   16    20    >   FE_FREE                                                  $7
         21      > RETURN                                                   !3
   13    22    > > JMP                                                      ->8
         23    >   FE_FREE                                                  $7
   19    24      > RETURN                                                   null

End of function getcloud

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.62 ms | 1400 KiB | 21 Q