3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = '<?xml version="1.0" encoding="UTF-8"?> <translations> <translation id="title"> <english name="name1" ad="ad1">Hello there, how are you?</english> <italian name="name2" ad="ad2">Ciao, come stai?</italian> </translation> <translation id="text2"> <english name="name3" ad="ad4">222Hello there, how are you?</english> <italian name="name3" ad="ad4">222Ciao, come stai?</italian> </translation> <translation id="text3"> <english name="name5" ad="ad5">333Hello there, how are you?</english> <italian name="name6" ad="ad6">333Ciao, come stai?</italian> </translation> </translations>'; $xml = new SimpleXMLElement($xml); //echo $xml->translation->english['ad'].PHP_EOL; echo $xml->translation['id']->italian['name']; foreach ($xml->translation as $element) { foreach($element as $key => $val) { echo $element['id']."{$key}: {$val}".PHP_EOL; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 26
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 26
Branch analysis from position: 13
2 jumps found. (Code = 77) Position 1 = 14, Position 2 = 24
Branch analysis from position: 14
2 jumps found. (Code = 78) Position 1 = 15, Position 2 = 24
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 24
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
filename:       /in/BICqn
function name:  (null)
number of ops:  28
compiled vars:  !0 = $xml, !1 = $element, !2 = $val, !3 = $key
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%3Ctranslations%3E%0A++++%3Ctranslation+id%3D%22title%22%3E%0A++++++++%3Cenglish+name%3D%22name1%22+ad%3D%22ad1%22%3EHello+there%2C+how+are+you%3F%3C%2Fenglish%3E%0A++++++++%3Citalian+name%3D%22name2%22+ad%3D%22ad2%22%3ECiao%2C+come+stai%3F%3C%2Fitalian%3E%0A++++%3C%2Ftranslation%3E%0A++++%3Ctranslation+id%3D%22text2%22%3E%0A++++++++%3Cenglish+name%3D%22name3%22+ad%3D%22ad4%22%3E222Hello+there%2C+how+are+you%3F%3C%2Fenglish%3E%0A++++++++%3Citalian+name%3D%22name3%22+ad%3D%22ad4%22%3E222Ciao%2C+come+stai%3F%3C%2Fitalian%3E%0A++++%3C%2Ftranslation%3E%0A++++%3Ctranslation+id%3D%22text3%22%3E%0A++++++++%3Cenglish+name%3D%22name5%22+ad%3D%22ad5%22%3E333Hello+there%2C+how+are+you%3F%3C%2Fenglish%3E%0A++++++++%3Citalian+name%3D%22name6%22+ad%3D%22ad6%22%3E333Ciao%2C+come+stai%3F%3C%2Fitalian%3E%0A++++%3C%2Ftranslation%3E%0A%3C%2Ftranslations%3E'
   20     1        NEW                                              $5      'SimpleXMLElement'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $5
   23     5        FETCH_OBJ_R                                      ~8      !0, 'translation'
          6        FETCH_DIM_R                                      ~9      ~8, 'id'
          7        FETCH_OBJ_R                                      ~10     ~9, 'italian'
          8        FETCH_DIM_R                                      ~11     ~10, 'name'
          9        ECHO                                                     ~11
   25    10        FETCH_OBJ_R                                      ~12     !0, 'translation'
         11      > FE_RESET_R                                       $13     ~12, ->26
         12    > > FE_FETCH_R                                               $13, !1, ->26
   26    13    > > FE_RESET_R                                       $14     !1, ->24
         14    > > FE_FETCH_R                                       ~15     $14, !2, ->24
         15    >   ASSIGN                                                   !3, ~15
   27    16        FETCH_DIM_R                                      ~17     !1, 'id'
         17        ROPE_INIT                                     3  ~19     !3
         18        ROPE_ADD                                      1  ~19     ~19, '%3A+'
         19        ROPE_END                                      2  ~18     ~19, !2
         20        CONCAT                                           ~21     ~17, ~18
         21        CONCAT                                           ~22     ~21, '%0A'
         22        ECHO                                                     ~22
   26    23      > JMP                                                      ->14
         24    >   FE_FREE                                                  $14
   25    25      > JMP                                                      ->12
         26    >   FE_FREE                                                  $13
   29    27      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.87 ms | 1399 KiB | 13 Q