3v4l.org

run code in 300+ PHP versions simultaneously
<?php $rss ='<?xml version="1.0" encoding="UTF-8"?> <rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/"> <channel> <item> <media:content url="http://blog.com/image1.jpg" width="661" height="310"/> </item> </channel> </rss>'; $xml = simplexml_load_string($rss); $urls = $xml->xpath('/rss/channel/item/media:content'); echo $urls[0]->attributes()->url; foreach ($urls as $url) { echo $url->attributes()->url; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 15, Position 2 = 21
Branch analysis from position: 15
2 jumps found. (Code = 78) Position 1 = 16, Position 2 = 21
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/Rj4uq
function name:  (null)
number of ops:  23
compiled vars:  !0 = $rss, !1 = $xml, !2 = $urls, !3 = $url
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3C%3Fxml+version%3D%221.0%22+encoding%3D%22UTF-8%22%3F%3E%0A%3Crss+version%3D%222.0%22+xmlns%3Amedia%3D%22http%3A%2F%2Fsearch.yahoo.com%2Fmrss%2F%22%3E%0A++++%3Cchannel%3E%0A++++++++%3Citem%3E%0A++++++++++++%3Cmedia%3Acontent+url%3D%22http%3A%2F%2Fblog.com%2Fimage1.jpg%22+width%3D%22661%22+height%3D%22310%22%2F%3E%0A++++++++%3C%2Fitem%3E%0A++++%3C%2Fchannel%3E%0A%3C%2Frss%3E'
   12     1        INIT_FCALL                                               'simplexml_load_string'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $5      
          4        ASSIGN                                                   !1, $5
   13     5        INIT_METHOD_CALL                                         !1, 'xpath'
          6        SEND_VAL_EX                                              '%2Frss%2Fchannel%2Fitem%2Fmedia%3Acontent'
          7        DO_FCALL                                      0  $7      
          8        ASSIGN                                                   !2, $7
   15     9        FETCH_DIM_R                                      ~9      !2, 0
         10        INIT_METHOD_CALL                                         ~9, 'attributes'
         11        DO_FCALL                                      0  $10     
         12        FETCH_OBJ_R                                      ~11     $10, 'url'
         13        ECHO                                                     ~11
   17    14      > FE_RESET_R                                       $12     !2, ->21
         15    > > FE_FETCH_R                                               $12, !3, ->21
   18    16    >   INIT_METHOD_CALL                                         !3, 'attributes'
         17        DO_FCALL                                      0  $13     
         18        FETCH_OBJ_R                                      ~14     $13, 'url'
         19        ECHO                                                     ~14
   17    20      > JMP                                                      ->15
         21    >   FE_FREE                                                  $12
   19    22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.39 ms | 1003 KiB | 14 Q