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'); $smses = $smses->getElementsByTagName('sms'); foreach ($smses 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 = 16, Position 2 = 33
Branch analysis from position: 16
2 jumps found. (Code = 78) Position 1 = 17, Position 2 = 33
Branch analysis from position: 17
2 jumps found. (Code = 77) Position 1 = 19, Position 2 = 31
Branch analysis from position: 19
2 jumps found. (Code = 78) Position 1 = 20, Position 2 = 31
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
Branch analysis from position: 31
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 33
filename:       /in/mOnrD
function name:  (null)
number of ops:  35
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        INIT_METHOD_CALL                                         !2, 'getElementsByTagName'
         12        SEND_VAL_EX                                              'sms'
         13        DO_FCALL                                      0  $14     
         14        ASSIGN                                                   !2, $14
   15    15      > FE_RESET_R                                       $16     !2, ->33
         16    > > FE_FETCH_R                                               $16, !3, ->33
   16    17    >   FETCH_OBJ_R                                      ~17     !3, 'attributes'
         18      > FE_RESET_R                                       $18     ~17, ->31
         19    > > FE_FETCH_R                                               $18, !4, ->31
   17    20    >   FETCH_OBJ_R                                      ~19     !4, 'nodeName'
         21        ASSIGN                                                   !5, ~19
   18    22        FETCH_OBJ_R                                      ~21     !4, 'nodeValue'
         23        ASSIGN                                                   !6, ~21
   19    24        ROPE_INIT                                     5  ~24     'Attribute+%27'
         25        ROPE_ADD                                      1  ~24     ~24, !5
         26        ROPE_ADD                                      2  ~24     ~24, '%27+%3A%3A+%27'
         27        ROPE_ADD                                      3  ~24     ~24, !6
         28        ROPE_END                                      4  ~23     ~24, '%27'
         29        ECHO                                                     ~23
   16    30      > JMP                                                      ->19
         31    >   FE_FREE                                                  $18
   15    32      > JMP                                                      ->16
         33    >   FE_FREE                                                  $16
   21    34      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.79 ms | 1399 KiB | 13 Q