3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = new SimpleXMLElement('<vehicle id="8"> <name>MAREK</name> <recorder>8</recorder> <production-date>0</production-date> <registration-number>SI40996</registration-number> <fuel> <type> </type> <nominal>0</nominal> <drive>0</drive> <work>0</work> <stay>0</stay> </fuel> <attributes> <attribute name="PHONE_NUMBER" type="5">123456789</attribute> <attribute name="EMAIL" type="5">w@wp.pl</attribute> </attributes> </vehicle>'); foreach ($xml->xpath('//vehicle[@id="8"]') as $item) { echo $item; foreach ($item->children() as $child) { echo $child; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 18
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 18
Branch analysis from position: 9
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 16
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 16
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 16
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/l8oL0
function name:  (null)
number of ops:  20
compiled vars:  !0 = $xml, !1 = $item, !2 = $child
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $3      'SimpleXMLElement'
          1        SEND_VAL_EX                                              '%3Cvehicle+id%3D%228%22%3E%0A++++%3Cname%3EMAREK%3C%2Fname%3E%0A++++%3Crecorder%3E8%3C%2Frecorder%3E%0A++++%3Cproduction-date%3E0%3C%2Fproduction-date%3E%0A++++%3Cregistration-number%3ESI40996%3C%2Fregistration-number%3E%0A++++%3Cfuel%3E%0A++++++%3Ctype%3E%0A++++++%3C%2Ftype%3E%0A++++++%3Cnominal%3E0%3C%2Fnominal%3E%0A++++++%3Cdrive%3E0%3C%2Fdrive%3E%0A++++++%3Cwork%3E0%3C%2Fwork%3E%0A++++++%3Cstay%3E0%3C%2Fstay%3E%0A++++%3C%2Ffuel%3E%0A++++%3Cattributes%3E%0A++++++%3Cattribute+name%3D%22PHONE_NUMBER%22+type%3D%225%22%3E123456789%3C%2Fattribute%3E%0A++++++%3Cattribute+name%3D%22EMAIL%22+type%3D%225%22%3Ew%40wp.pl%3C%2Fattribute%3E%0A++++%3C%2Fattributes%3E%0A++%3C%2Fvehicle%3E'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $3
   22     4        INIT_METHOD_CALL                                         !0, 'xpath'
          5        SEND_VAL_EX                                              '%2F%2Fvehicle%5B%40id%3D%228%22%5D'
          6        DO_FCALL                                      0  $6      
          7      > FE_RESET_R                                       $7      $6, ->18
          8    > > FE_FETCH_R                                               $7, !1, ->18
   24     9    >   ECHO                                                     !1
   25    10        INIT_METHOD_CALL                                         !1, 'children'
         11        DO_FCALL                                      0  $8      
         12      > FE_RESET_R                                       $9      $8, ->16
         13    > > FE_FETCH_R                                               $9, !2, ->16
   26    14    >   ECHO                                                     !2
   25    15      > JMP                                                      ->13
         16    >   FE_FREE                                                  $9
   22    17      > JMP                                                      ->8
         18    >   FE_FREE                                                  $7
   28    19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.81 ms | 1395 KiB | 13 Q