3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml='<workout_file> <workout> <FreeRide Duration="300" Power="1.3"/> <SteadyState Duration="300" Power="0.55"/> <FreeRide Duration="10" Power="1.2"/> <SteadyState Duration="180" Power="0.55"/> <FreeRide Duration="10" Power="1.1"/> <SteadyState Duration="120" Power="0.55"/> </workout> </workout_file>'; $xml=simplexml_load_string($xml); $count = 0; foreach($xml->workout->children() as $node ){ $type = $node->getName(); echo $type." position: ".$count."<br>"; $count++; //Get Attributes echo "Duration: ".$node['Duration']."<br>"; echo "Power: ".$node['Power']."<br>"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 28
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 28
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
filename:       /in/MKUEZ
function name:  (null)
number of ops:  30
compiled vars:  !0 = $xml, !1 = $count, !2 = $node, !3 = $type
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3Cworkout_file%3E%0A++++%3Cworkout%3E%0A+++++++%3CFreeRide+Duration%3D%22300%22+Power%3D%221.3%22%2F%3E%0A++++++++%3CSteadyState+Duration%3D%22300%22+Power%3D%220.55%22%2F%3E%0A++++++++%3CFreeRide+Duration%3D%2210%22++Power%3D%221.2%22%2F%3E%0A++++++++%3CSteadyState+Duration%3D%22180%22+Power%3D%220.55%22%2F%3E%0A++++++++%3CFreeRide+Duration%3D%2210%22++Power%3D%221.1%22%2F%3E%0A++++++++%3CSteadyState+Duration%3D%22120%22+Power%3D%220.55%22%2F%3E%0A++++%3C%2Fworkout%3E%0A%3C%2Fworkout_file%3E'
   13     1        INIT_FCALL                                               'simplexml_load_string'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $5      
          4        ASSIGN                                                   !0, $5
   15     5        ASSIGN                                                   !1, 0
   16     6        FETCH_OBJ_R                                      ~8      !0, 'workout'
          7        INIT_METHOD_CALL                                         ~8, 'children'
          8        DO_FCALL                                      0  $9      
          9      > FE_RESET_R                                       $10     $9, ->28
         10    > > FE_FETCH_R                                               $10, !2, ->28
   17    11    >   INIT_METHOD_CALL                                         !2, 'getName'
         12        DO_FCALL                                      0  $11     
         13        ASSIGN                                                   !3, $11
   18    14        CONCAT                                           ~13     !3, '+position%3A+'
         15        CONCAT                                           ~14     ~13, !1
         16        CONCAT                                           ~15     ~14, '%3Cbr%3E'
         17        ECHO                                                     ~15
   19    18        PRE_INC                                                  !1
   22    19        FETCH_DIM_R                                      ~17     !2, 'Duration'
         20        CONCAT                                           ~18     'Duration%3A+', ~17
         21        CONCAT                                           ~19     ~18, '%3Cbr%3E'
         22        ECHO                                                     ~19
   23    23        FETCH_DIM_R                                      ~20     !2, 'Power'
         24        CONCAT                                           ~21     'Power%3A+', ~20
         25        CONCAT                                           ~22     ~21, '%3Cbr%3E'
         26        ECHO                                                     ~22
   16    27      > JMP                                                      ->10
         28    >   FE_FREE                                                  $10
   24    29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
251.21 ms | 999 KiB | 14 Q