3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xmlData = "<?xml version='1.0'?> <methodResponse> <params> <param> <value><array><data> <value><struct> <member> <name>description</name> <value><string></string></value> </member> </struct></value> </data></array></value> </param> </params> </methodResponse>"; $plainParsed = simplexml_load_string($xmlData); $NoNewLineParsed = simplexml_load_string(str_replace(array("\n", "\r"), '', $xmlData)); $testArray = array($plainParsed, $NoNewLineParsed); foreach ($testArray as $test) { var_dump( $test->params->param->value->array->data->value->struct->member->value ); } //first pass (new lines not removed) returns array //second pass (new lines removed) returns element
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 18, Position 2 = 32
Branch analysis from position: 18
2 jumps found. (Code = 78) Position 1 = 19, Position 2 = 32
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
filename:       /in/GGGnX
function name:  (null)
number of ops:  34
compiled vars:  !0 = $xmlData, !1 = $plainParsed, !2 = $NoNewLineParsed, !3 = $testArray, !4 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3C%3Fxml+version%3D%271.0%27%3F%3E%0A%3CmethodResponse%3E%0A%3Cparams%3E%0A%3Cparam%3E%0A%3Cvalue%3E%3Carray%3E%3Cdata%3E%0A%3Cvalue%3E%3Cstruct%3E%0A%3Cmember%3E%0A%3Cname%3Edescription%3C%2Fname%3E%0A%3Cvalue%3E%3Cstring%3E%3C%2Fstring%3E%3C%2Fvalue%3E%0A%3C%2Fmember%3E%0A%3C%2Fstruct%3E%3C%2Fvalue%3E%0A%3C%2Fdata%3E%3C%2Farray%3E%3C%2Fvalue%3E%0A%3C%2Fparam%3E%0A%3C%2Fparams%3E%0A%3C%2FmethodResponse%3E'
   19     1        INIT_FCALL                                               'simplexml_load_string'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $6      
          4        ASSIGN                                                   !1, $6
   20     5        INIT_FCALL                                               'simplexml_load_string'
          6        INIT_FCALL                                               'str_replace'
          7        SEND_VAL                                                 <array>
          8        SEND_VAL                                                 ''
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $8      
         11        SEND_VAR                                                 $8
         12        DO_ICALL                                         $9      
         13        ASSIGN                                                   !2, $9
   21    14        INIT_ARRAY                                       ~11     !1
         15        ADD_ARRAY_ELEMENT                                ~11     !2
         16        ASSIGN                                                   !3, ~11
   22    17      > FE_RESET_R                                       $13     !3, ->32
         18    > > FE_FETCH_R                                               $13, !4, ->32
   23    19    >   INIT_FCALL                                               'var_dump'
   24    20        FETCH_OBJ_R                                      ~14     !4, 'params'
         21        FETCH_OBJ_R                                      ~15     ~14, 'param'
         22        FETCH_OBJ_R                                      ~16     ~15, 'value'
         23        FETCH_OBJ_R                                      ~17     ~16, 'array'
         24        FETCH_OBJ_R                                      ~18     ~17, 'data'
         25        FETCH_OBJ_R                                      ~19     ~18, 'value'
         26        FETCH_OBJ_R                                      ~20     ~19, 'struct'
         27        FETCH_OBJ_R                                      ~21     ~20, 'member'
         28        FETCH_OBJ_R                                      ~22     ~21, 'value'
         29        SEND_VAL                                                 ~22
         30        DO_ICALL                                                 
   22    31      > JMP                                                      ->18
         32    >   FE_FREE                                                  $13
   28    33      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.62 ms | 1388 KiB | 19 Q