3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = simplexml_load_file('http://weather.yahooapis.com/forecastrss?w=868274&u=c'); $weatherInfo = $xml->channel->item->description; $imagePattern = '/src="(.*?)"/i'; preg_match($imagePattern, $weatherInfo, $matches); $imageSrc = $matches[1]; $degreesPattern = '/.*?, (-?\d+) C/i'; preg_match($degreesPattern, $weatherInfo, $matches); $degrees = $matches[1]; echo $degrees;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qfSfE
function name:  (null)
number of ops:  26
compiled vars:  !0 = $xml, !1 = $weatherInfo, !2 = $imagePattern, !3 = $matches, !4 = $imageSrc, !5 = $degreesPattern, !6 = $degrees
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'simplexml_load_file'
          1        SEND_VAL                                                 'http%3A%2F%2Fweather.yahooapis.com%2Fforecastrss%3Fw%3D868274%26u%3Dc'
          2        DO_ICALL                                         $7      
          3        ASSIGN                                                   !0, $7
    3     4        FETCH_OBJ_R                                      ~9      !0, 'channel'
          5        FETCH_OBJ_R                                      ~10     ~9, 'item'
          6        FETCH_OBJ_R                                      ~11     ~10, 'description'
          7        ASSIGN                                                   !1, ~11
    4     8        ASSIGN                                                   !2, '%2Fsrc%3D%22%28.%2A%3F%29%22%2Fi'
    5     9        INIT_FCALL                                               'preg_match'
         10        SEND_VAR                                                 !2
         11        SEND_VAR                                                 !1
         12        SEND_REF                                                 !3
         13        DO_ICALL                                                 
    6    14        FETCH_DIM_R                                      ~15     !3, 1
         15        ASSIGN                                                   !4, ~15
    7    16        ASSIGN                                                   !5, '%2F.%2A%3F%2C+%28-%3F%5Cd%2B%29+C%2Fi'
    8    17        INIT_FCALL                                               'preg_match'
         18        SEND_VAR                                                 !5
         19        SEND_VAR                                                 !1
         20        SEND_REF                                                 !3
         21        DO_ICALL                                                 
    9    22        FETCH_DIM_R                                      ~19     !3, 1
         23        ASSIGN                                                   !6, ~19
   10    24        ECHO                                                     !6
         25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.03 ms | 1387 KiB | 17 Q