3v4l.org

run code in 300+ PHP versions simultaneously
<?php function fetch_news(){ $data = file_get_contents('http://www.tagesschau.de/xml/rss2'); $data = simplexml_load_string($data); //print_r($data); $articles = array(); foreach ($data->channel->item as $item) { $articles[] = array( 'title' => (string)$item->title, 'description' => (string)$item->description, 'link' => (string)$item->link, 'date' => (string)$item->pubDate, ); } //print_r($articles); } foreach (fetch_news() as $article){ $article['link']; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/gO3iJ
function name:  (null)
number of ops:  9
compiled vars:  !0 = $article
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   INIT_FCALL                                               'fetch_news'
          1        DO_FCALL                                      0  $1      
          2      > FE_RESET_R                                       $2      $1, ->7
          3    > > FE_FETCH_R                                               $2, !0, ->7
   25     4    >   FETCH_DIM_R                                      ~3      !0, 'link'
          5        FREE                                                     ~3
   23     6      > JMP                                                      ->3
          7    >   FE_FREE                                                  $2
   27     8      > RETURN                                                   1

Function fetch_news:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 28
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 28
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
filename:       /in/gO3iJ
function name:  fetch_news
number of ops:  30
compiled vars:  !0 = $data, !1 = $articles, !2 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'file_get_contents'
          1        SEND_VAL                                                 'http%3A%2F%2Fwww.tagesschau.de%2Fxml%2Frss2'
          2        DO_ICALL                                         $3      
          3        ASSIGN                                                   !0, $3
    4     4        INIT_FCALL                                               'simplexml_load_string'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $5      
          7        ASSIGN                                                   !0, $5
    8     8        ASSIGN                                                   !1, <array>
    9     9        FETCH_OBJ_R                                      ~8      !0, 'channel'
         10        FETCH_OBJ_R                                      ~9      ~8, 'item'
         11      > FE_RESET_R                                       $10     ~9, ->28
         12    > > FE_FETCH_R                                               $10, !2, ->28
   12    13    >   FETCH_OBJ_R                                      ~12     !2, 'title'
         14        CAST                                          6  ~13     ~12
         15        INIT_ARRAY                                       ~14     ~13, 'title'
   13    16        FETCH_OBJ_R                                      ~15     !2, 'description'
         17        CAST                                          6  ~16     ~15
         18        ADD_ARRAY_ELEMENT                                ~14     ~16, 'description'
   14    19        FETCH_OBJ_R                                      ~17     !2, 'link'
         20        CAST                                          6  ~18     ~17
         21        ADD_ARRAY_ELEMENT                                ~14     ~18, 'link'
   15    22        FETCH_OBJ_R                                      ~19     !2, 'pubDate'
         23        CAST                                          6  ~20     ~19
         24        ADD_ARRAY_ELEMENT                                ~14     ~20, 'date'
   11    25        ASSIGN_DIM                                               !1
   15    26        OP_DATA                                                  ~14
    9    27      > JMP                                                      ->12
         28    >   FE_FREE                                                  $10
   20    29      > RETURN                                                   null

End of function fetch_news

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.56 ms | 1403 KiB | 18 Q