3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = <<<DATA <PportTimetable timetableID="20180124020740"> <Journey rid="201801247176474" uid="G76474" trainId="2H98" ssd="2018-01-24" toc="SN"> <OR tpl="BCKNMJC" act="TB" ptd="07:15" wtd="07:15" /> <IP tpl="BIRKBCK" act="T " pta="07:18" ptd="07:18" wta="07:17:30" wtd="07:18" /> <PP tpl="CRYSBRJ" wtp="07:20" /> <IP tpl="CRYSTLP" act="T " plat="1" pta="07:22" ptd="07:22" wta="07:21:30" wtd="07:22" /> <IP tpl="GIPSYH" act="T " pta="07:25" ptd="07:25" wta="07:24:30" wtd="07:25" /> <IP tpl="WNORWOD" act="T " plat="1" pta="07:28" ptd="07:28" wta="07:27:30" wtd="07:28" /> <PP tpl="WNORWDJ" wtp="07:29" /> <IP tpl="TULSEH" act="T " plat="3" pta="07:31" ptd="07:34" wta="07:31" wtd="07:34" /> <IP tpl="NDULWCH" act="T " pta="07:37" ptd="07:37" wta="07:36:30" wtd="07:37:30" /> <IP tpl="EDULWCH" act="T " pta="07:39" ptd="07:40" wta="07:39" wtd="07:40" /> <IP tpl="PKHMRYC" act="T " plat="2" pta="07:42" ptd="07:43" wta="07:42" wtd="07:43" /> <IP tpl="PCKHMQD" act="T " plat="1" pta="07:45" ptd="07:45" wta="07:45" wtd="07:45:30" /> <PP tpl="OLDKRDJ" wtp="07:46" /> <DT tpl="SBRMNDS" act="TF" pta="07:52" wta="07:52" /> </Journey> <Journey rid="201801248980806" uid="Y80806" trainId="5G45" ssd="2018-01-24" toc="VT" trainCat="EE" isPassengerSvc="false"> <OPOR tpl="WVRMPTN" act="TB" plat="1" wtd="22:40" /> <PP tpl="WVRMTNJ" wtp="22:41:30" /> <PP tpl="WVRMSRJ" wtp="22:44" /> <OPDT tpl="OXLEYCS" act="TF" wta="22:47" /> </Journey> </PportTimetable> DATA; $xml = simplexml_load_string($data); $timetableId = $xml->attributes()->timetableID; echo "Timetable id: " . $timetableId . "\n\r"; foreach ($xml->Journey as $Journey) { echo "Journey data: " . $Journey["rid"] . "\n\r"; echo "Journey data: " . $Journey["uid"] . "\n\r"; echo "Journey data: " . $Journey["trainId"] . "\n\r"; echo "Journey data: " . $Journey["ssd"] . "\n\r"; echo "Journey data: " . $Journey["toc"] . "\n\r"; foreach ($Journey->children() as $child) { if ($child->getName() === "IP") { echo $child['tpl'] . PHP_EOL; } } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 14, Position 2 = 49
Branch analysis from position: 14
2 jumps found. (Code = 78) Position 1 = 15, Position 2 = 49
Branch analysis from position: 15
2 jumps found. (Code = 77) Position 1 = 38, Position 2 = 47
Branch analysis from position: 38
2 jumps found. (Code = 78) Position 1 = 39, Position 2 = 47
Branch analysis from position: 39
2 jumps found. (Code = 43) Position 1 = 43, Position 2 = 46
Branch analysis from position: 43
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
Branch analysis from position: 46
Branch analysis from position: 47
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 47
Branch analysis from position: 49
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 49
filename:       /in/jSd0Q
function name:  (null)
number of ops:  51
compiled vars:  !0 = $data, !1 = $xml, !2 = $timetableId, !3 = $Journey, !4 = $child
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3CPportTimetable+timetableID%3D%2220180124020740%22%3E%0A++++%3CJourney+rid%3D%22201801247176474%22+uid%3D%22G76474%22+trainId%3D%222H98%22+ssd%3D%222018-01-24%22+toc%3D%22SN%22%3E%0A++++++++%3COR+tpl%3D%22BCKNMJC%22+act%3D%22TB%22+ptd%3D%2207%3A15%22+wtd%3D%2207%3A15%22+%2F%3E%0A++++++++%3CIP+tpl%3D%22BIRKBCK%22+act%3D%22T+%22+pta%3D%2207%3A18%22+ptd%3D%2207%3A18%22+wta%3D%2207%3A17%3A30%22+wtd%3D%2207%3A18%22+%2F%3E%0A++++++++%3CPP+tpl%3D%22CRYSBRJ%22+wtp%3D%2207%3A20%22+%2F%3E%0A++++++++%3CIP+tpl%3D%22CRYSTLP%22+act%3D%22T+%22+plat%3D%221%22+pta%3D%2207%3A22%22+ptd%3D%2207%3A22%22+wta%3D%2207%3A21%3A30%22+wtd%3D%2207%3A22%22+%2F%3E%0A++++++++%3CIP+tpl%3D%22GIPSYH%22+act%3D%22T+%22+pta%3D%2207%3A25%22+ptd%3D%2207%3A25%22+wta%3D%2207%3A24%3A30%22+wtd%3D%2207%3A25%22+%2F%3E%0A++++++++%3CIP+tpl%3D%22WNORWOD%22+act%3D%22T+%22+plat%3D%221%22+pta%3D%2207%3A28%22+ptd%3D%2207%3A28%22+wta%3D%2207%3A27%3A30%22+wtd%3D%2207%3A28%22+%2F%3E%0A++++++++%3CPP+tpl%3D%22WNORWDJ%22+wtp%3D%2207%3A29%22+%2F%3E%0A++++++++%3CIP+tpl%3D%22TULSEH%22+act%3D%22T+%22+plat%3D%223%22+pta%3D%2207%3A31%22+ptd%3D%2207%3A34%22+wta%3D%2207%3A31%22+wtd%3D%2207%3A34%22+%2F%3E%0A++++++++%3CIP+tpl%3D%22NDULWCH%22+act%3D%22T+%22+pta%3D%2207%3A37%22+ptd%3D%2207%3A37%22+wta%3D%2207%3A36%3A30%22+wtd%3D%2207%3A37%3A30%22+%2F%3E%0A++++++++%3CIP+tpl%3D%22EDULWCH%22+act%3D%22T+%22+pta%3D%2207%3A39%22+ptd%3D%2207%3A40%22+wta%3D%2207%3A39%22+wtd%3D%2207%3A40%22+%2F%3E%0A++++++++%3CIP+tpl%3D%22PKHMRYC%22+act%3D%22T+%22+plat%3D%222%22+pta%3D%2207%3A42%22+ptd%3D%2207%3A43%22+wta%3D%2207%3A42%22+wtd%3D%2207%3A43%22+%2F%3E%0A++++++++%3CIP+tpl%3D%22PCKHMQD%22+act%3D%22T+%22+plat%3D%221%22+pta%3D%2207%3A45%22+ptd%3D%2207%3A45%22+wta%3D%2207%3A45%22+wtd%3D%2207%3A45%3A30%22+%2F%3E%0A++++++++%3CPP+tpl%3D%22OLDKRDJ%22+wtp%3D%2207%3A46%22+%2F%3E%0A++++++++%3CDT+tpl%3D%22SBRMNDS%22+act%3D%22TF%22+pta%3D%2207%3A52%22+wta%3D%2207%3A52%22+%2F%3E%0A++++%3C%2FJourney%3E%0A%0A++++%3CJourney+rid%3D%22201801248980806%22+uid%3D%22Y80806%22+trainId%3D%225G45%22+ssd%3D%222018-01-24%22+toc%3D%22VT%22+trainCat%3D%22EE%22+isPassengerSvc%3D%22false%22%3E%0A++++++++%3COPOR+tpl%3D%22WVRMPTN%22+act%3D%22TB%22+plat%3D%221%22+wtd%3D%2222%3A40%22+%2F%3E%0A++++++++%3CPP+tpl%3D%22WVRMTNJ%22+wtp%3D%2222%3A41%3A30%22+%2F%3E%0A++++++++%3CPP+tpl%3D%22WVRMSRJ%22+wtp%3D%2222%3A44%22+%2F%3E%0A++++++++%3COPDT+tpl%3D%22OXLEYCS%22+act%3D%22TF%22+wta%3D%2222%3A47%22+%2F%3E%0A++++%3C%2FJourney%3E%0A%3C%2FPportTimetable%3E'
   31     1        INIT_FCALL                                               'simplexml_load_string'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $6      
          4        ASSIGN                                                   !1, $6
   33     5        INIT_METHOD_CALL                                         !1, 'attributes'
          6        DO_FCALL                                      0  $8      
          7        FETCH_OBJ_R                                      ~9      $8, 'timetableID'
          8        ASSIGN                                                   !2, ~9
   34     9        CONCAT                                           ~11     'Timetable+id%3A+', !2
         10        CONCAT                                           ~12     ~11, '%0A%0D'
         11        ECHO                                                     ~12
   35    12        FETCH_OBJ_R                                      ~13     !1, 'Journey'
         13      > FE_RESET_R                                       $14     ~13, ->49
         14    > > FE_FETCH_R                                               $14, !3, ->49
   36    15    >   FETCH_DIM_R                                      ~15     !3, 'rid'
         16        CONCAT                                           ~16     'Journey+data%3A+', ~15
         17        CONCAT                                           ~17     ~16, '%0A%0D'
         18        ECHO                                                     ~17
   37    19        FETCH_DIM_R                                      ~18     !3, 'uid'
         20        CONCAT                                           ~19     'Journey+data%3A+', ~18
         21        CONCAT                                           ~20     ~19, '%0A%0D'
         22        ECHO                                                     ~20
   38    23        FETCH_DIM_R                                      ~21     !3, 'trainId'
         24        CONCAT                                           ~22     'Journey+data%3A+', ~21
         25        CONCAT                                           ~23     ~22, '%0A%0D'
         26        ECHO                                                     ~23
   39    27        FETCH_DIM_R                                      ~24     !3, 'ssd'
         28        CONCAT                                           ~25     'Journey+data%3A+', ~24
         29        CONCAT                                           ~26     ~25, '%0A%0D'
         30        ECHO                                                     ~26
   40    31        FETCH_DIM_R                                      ~27     !3, 'toc'
         32        CONCAT                                           ~28     'Journey+data%3A+', ~27
         33        CONCAT                                           ~29     ~28, '%0A%0D'
         34        ECHO                                                     ~29
   41    35        INIT_METHOD_CALL                                         !3, 'children'
         36        DO_FCALL                                      0  $30     
         37      > FE_RESET_R                                       $31     $30, ->47
         38    > > FE_FETCH_R                                               $31, !4, ->47
   42    39    >   INIT_METHOD_CALL                                         !4, 'getName'
         40        DO_FCALL                                      0  $32     
         41        IS_IDENTICAL                                             $32, 'IP'
         42      > JMPZ                                                     ~33, ->46
   43    43    >   FETCH_DIM_R                                      ~34     !4, 'tpl'
         44        CONCAT                                           ~35     ~34, '%0A'
         45        ECHO                                                     ~35
   41    46    > > JMP                                                      ->38
         47    >   FE_FREE                                                  $31
   35    48      > JMP                                                      ->14
         49    >   FE_FREE                                                  $14
   46    50      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
277.04 ms | 1007 KiB | 14 Q