3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = <<<XML <smses count="1099"> <sms protocol="0" address="" date="" type="" subject="" body="" toa="null" sc_toa="null" service_center="null" read="1" status="-1" locked="0" date_sent="null" readable_date="" contact_name="" /> </smses> XML; $dom = new DOMDocument(); $dom->loadXML($xml); $smses = $dom->getElementsByTagName('smses'); foreach ($smses->sms as $sms) { foreach ($sms->attributes as $attr) { $name = $attr->nodeName; $value = $attr->nodeValue; echo "Attribute '$name' :: '$value'"; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 30
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 30
Branch analysis from position: 14
2 jumps found. (Code = 77) Position 1 = 16, Position 2 = 28
Branch analysis from position: 16
2 jumps found. (Code = 78) Position 1 = 17, Position 2 = 28
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 28
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 30
filename:       /in/nBEhO
function name:  (null)
number of ops:  32
compiled vars:  !0 = $xml, !1 = $dom, !2 = $smses, !3 = $sms, !4 = $attr, !5 = $name, !6 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3Csmses+count%3D%221099%22%3E+++%3Csms+protocol%3D%220%22+address%3D%22%22+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%0A+++++++++++date%3D%22%22+type%3D%22%22+subject%3D%22%22+body%3D%22%22+toa%3D%22null%22+sc_toa%3D%22null%22++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%0A+++++++++++service_center%3D%22null%22+read%3D%221%22+status%3D%22-1%22+locked%3D%220%22++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%0A+++++++++++date_sent%3D%22null%22+readable_date%3D%22%22+contact_name%3D%22%22+%2F%3E+%3C%2Fsmses%3E'
   11     1        NEW                                              $8      'DOMDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $8
   12     4        INIT_METHOD_CALL                                         !1, 'loadXML'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
   13     7        INIT_METHOD_CALL                                         !1, 'getElementsByTagName'
          8        SEND_VAL_EX                                              'smses'
          9        DO_FCALL                                      0  $12     
         10        ASSIGN                                                   !2, $12
   14    11        FETCH_OBJ_R                                      ~14     !2, 'sms'
         12      > FE_RESET_R                                       $15     ~14, ->30
         13    > > FE_FETCH_R                                               $15, !3, ->30
   15    14    >   FETCH_OBJ_R                                      ~16     !3, 'attributes'
         15      > FE_RESET_R                                       $17     ~16, ->28
         16    > > FE_FETCH_R                                               $17, !4, ->28
   16    17    >   FETCH_OBJ_R                                      ~18     !4, 'nodeName'
         18        ASSIGN                                                   !5, ~18
   17    19        FETCH_OBJ_R                                      ~20     !4, 'nodeValue'
         20        ASSIGN                                                   !6, ~20
   18    21        ROPE_INIT                                     5  ~23     'Attribute+%27'
         22        ROPE_ADD                                      1  ~23     ~23, !5
         23        ROPE_ADD                                      2  ~23     ~23, '%27+%3A%3A+%27'
         24        ROPE_ADD                                      3  ~23     ~23, !6
         25        ROPE_END                                      4  ~22     ~23, '%27'
         26        ECHO                                                     ~22
   15    27      > JMP                                                      ->16
         28    >   FE_FREE                                                  $17
   14    29      > JMP                                                      ->13
         30    >   FE_FREE                                                  $15
   20    31      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.32 ms | 1399 KiB | 13 Q