3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = "<xml> <data> <parameters> <temperature> <value name='1'></value> <value name='2'></value> </temperature> </parameters> </data> </xml>"; $xml = simplexml_load_string( $xml); foreach( $xml->data[0]->parameters[0]->temperature[0]->xpath( 'value') as $child) { echo $child->attributes()['name'] . "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 15, Position 2 = 22
Branch analysis from position: 15
2 jumps found. (Code = 78) Position 1 = 16, Position 2 = 22
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/lo5Ag
function name:  (null)
number of ops:  24
compiled vars:  !0 = $xml, !1 = $child
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3Cxml%3E%0A%09%3Cdata%3E%0A%09%09%3Cparameters%3E%0A%3Ctemperature%3E%0A%3Cvalue+name%3D%271%27%3E%3C%2Fvalue%3E%0A%3Cvalue+name%3D%272%27%3E%3C%2Fvalue%3E%0A%3C%2Ftemperature%3E%0A%09%09%3C%2Fparameters%3E%0A%09%3C%2Fdata%3E%0A%3C%2Fxml%3E'
   13     1        INIT_FCALL                                               'simplexml_load_string'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $3      
          4        ASSIGN                                                   !0, $3
   15     5        FETCH_OBJ_R                                      ~5      !0, 'data'
          6        FETCH_DIM_R                                      ~6      ~5, 0
          7        FETCH_OBJ_R                                      ~7      ~6, 'parameters'
          8        FETCH_DIM_R                                      ~8      ~7, 0
          9        FETCH_OBJ_R                                      ~9      ~8, 'temperature'
         10        FETCH_DIM_R                                      ~10     ~9, 0
         11        INIT_METHOD_CALL                                         ~10, 'xpath'
         12        SEND_VAL_EX                                              'value'
         13        DO_FCALL                                      0  $11     
         14      > FE_RESET_R                                       $12     $11, ->22
         15    > > FE_FETCH_R                                               $12, !1, ->22
   16    16    >   INIT_METHOD_CALL                                         !1, 'attributes'
         17        DO_FCALL                                      0  $13     
         18        FETCH_DIM_R                                      ~14     $13, 'name'
         19        CONCAT                                           ~15     ~14, '%0A'
         20        ECHO                                                     ~15
   15    21      > JMP                                                      ->15
         22    >   FE_FREE                                                  $12
   17    23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.4 ms | 1387 KiB | 15 Q