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->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 = 11, Position 2 = 25
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 25
Branch analysis from position: 12
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 23
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 23
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 23
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/Nsuba
function name:  (null)
number of ops:  27
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_OBJ_R                                      ~9      ~8, 'italian'
          7        FETCH_DIM_R                                      ~10     ~9, 'name'
          8        ECHO                                                     ~10
   25     9        FETCH_OBJ_R                                      ~11     !0, 'translation'
         10      > FE_RESET_R                                       $12     ~11, ->25
         11    > > FE_FETCH_R                                               $12, !1, ->25
   26    12    > > FE_RESET_R                                       $13     !1, ->23
         13    > > FE_FETCH_R                                       ~14     $13, !2, ->23
         14    >   ASSIGN                                                   !3, ~14
   27    15        FETCH_DIM_R                                      ~16     !1, 'id'
         16        ROPE_INIT                                     3  ~18     !3
         17        ROPE_ADD                                      1  ~18     ~18, '%3A+'
         18        ROPE_END                                      2  ~17     ~18, !2
         19        CONCAT                                           ~20     ~16, ~17
         20        CONCAT                                           ~21     ~20, '%0A'
         21        ECHO                                                     ~21
   26    22      > JMP                                                      ->13
         23    >   FE_FREE                                                  $13
   25    24      > JMP                                                      ->11
         25    >   FE_FREE                                                  $12
   29    26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.1 ms | 1399 KiB | 13 Q