3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = '<?xml version="1.0" encoding="utf-8"?> <rss xmlns:g="http://base.google.com/ns/1.0" version="2.0"> <channel> <title>werwer</title> <link>werwerwe</link> <item> <g:id>704667</g:id> <title>Nike</title> <description>erterterter</description> </item> <item> <g:id>4456456</g:id> <title>Nike</title> <description>erterterter</description> </item> </channel></rss>'; $xml = simplexml_load_string($xml); $ns = $xml->getNamespaces(true); foreach ($xml->channel->item as $item) { echo $item->children($ns['g'])->id.PHP_EOL; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 22
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 22
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/t2D84
function name:  (null)
number of ops:  24
compiled vars:  !0 = $xml, !1 = $ns, !2 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3C%3Fxml+version%3D%221.0%22+encoding%3D%22utf-8%22%3F%3E%0A%3Crss+xmlns%3Ag%3D%22http%3A%2F%2Fbase.google.com%2Fns%2F1.0%22+version%3D%222.0%22%3E%0A%3Cchannel%3E%0A%3Ctitle%3Ewerwer%3C%2Ftitle%3E%0A%3Clink%3Ewerwerwe%3C%2Flink%3E%0A%0A%3Citem%3E%0A%3Cg%3Aid%3E704667%3C%2Fg%3Aid%3E%0A%3Ctitle%3ENike%3C%2Ftitle%3E%0A%3Cdescription%3Eerterterter%3C%2Fdescription%3E%0A%3C%2Fitem%3E%0A%0A%3Citem%3E%0A%3Cg%3Aid%3E4456456%3C%2Fg%3Aid%3E%0A%3Ctitle%3ENike%3C%2Ftitle%3E%0A%3Cdescription%3Eerterterter%3C%2Fdescription%3E%0A%3C%2Fitem%3E%0A%0A%3C%2Fchannel%3E%3C%2Frss%3E'
   22     1        INIT_FCALL                                               'simplexml_load_string'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $4      
          4        ASSIGN                                                   !0, $4
   23     5        INIT_METHOD_CALL                                         !0, 'getNamespaces'
          6        SEND_VAL_EX                                              <true>
          7        DO_FCALL                                      0  $6      
          8        ASSIGN                                                   !1, $6
   25     9        FETCH_OBJ_R                                      ~8      !0, 'channel'
         10        FETCH_OBJ_R                                      ~9      ~8, 'item'
         11      > FE_RESET_R                                       $10     ~9, ->22
         12    > > FE_FETCH_R                                               $10, !2, ->22
   26    13    >   INIT_METHOD_CALL                                         !2, 'children'
         14        CHECK_FUNC_ARG                                           
         15        FETCH_DIM_FUNC_ARG                               $11     !1, 'g'
         16        SEND_FUNC_ARG                                            $11
         17        DO_FCALL                                      0  $12     
         18        FETCH_OBJ_R                                      ~13     $12, 'id'
         19        CONCAT                                           ~14     ~13, '%0A'
         20        ECHO                                                     ~14
   25    21      > JMP                                                      ->12
         22    >   FE_FREE                                                  $10
   27    23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.03 ms | 1003 KiB | 14 Q