3v4l.org

run code in 300+ PHP versions simultaneously
<?php $s = '<root> <Formula> <formulaname attr="1.0">Basic</formulaname> <movespeed>1</movespeed> <box>4</box> <chicken>3</chicken> <ducks> <duck>test1</duck> <duck a="b">test2</duck> <duck>test3</duck> </ducks> <cereal>2</cereal> </Formula> </root>'; $xml = simplexml_load_string($s); $arr = (array) $xml; $newArr = (array)$arr['Formula']; $it = new SimpleXMLIterator($xml); var_dump($it->current());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Pcgo5
function name:  (null)
number of ops:  20
compiled vars:  !0 = $s, !1 = $xml, !2 = $arr, !3 = $newArr, !4 = $it
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3Croot%3E%0A%3CFormula%3E%0A%3Cformulaname+attr%3D%221.0%22%3EBasic%3C%2Fformulaname%3E%0A%3Cmovespeed%3E1%3C%2Fmovespeed%3E%0A%3Cbox%3E4%3C%2Fbox%3E%0A%3Cchicken%3E3%3C%2Fchicken%3E%0A%3Cducks%3E%0A++%3Cduck%3Etest1%3C%2Fduck%3E%0A++%3Cduck+a%3D%22b%22%3Etest2%3C%2Fduck%3E%0A++%3Cduck%3Etest3%3C%2Fduck%3E%0A%3C%2Fducks%3E%0A%3Ccereal%3E2%3C%2Fcereal%3E%0A%3C%2FFormula%3E%0A%3C%2Froot%3E'
   18     1        INIT_FCALL                                               'simplexml_load_string'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $6      
          4        ASSIGN                                                   !1, $6
   19     5        CAST                                          7  ~8      !1
          6        ASSIGN                                                   !2, ~8
   20     7        FETCH_DIM_R                                      ~10     !2, 'Formula'
          8        CAST                                          7  ~11     ~10
          9        ASSIGN                                                   !3, ~11
   21    10        NEW                                              $13     'SimpleXMLIterator'
         11        SEND_VAR_EX                                              !1
         12        DO_FCALL                                      0          
         13        ASSIGN                                                   !4, $13
   22    14        INIT_FCALL                                               'var_dump'
         15        INIT_METHOD_CALL                                         !4, 'current'
         16        DO_FCALL                                      0  $16     
         17        SEND_VAR                                                 $16
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.64 ms | 1395 KiB | 17 Q