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($arr['Formula']->ducks); var_dump($arr['Formula']->ducks, $it->next());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/haTB1
function name:  (null)
number of ops:  26
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        CHECK_FUNC_ARG                                           
         12        FETCH_DIM_FUNC_ARG                               $14     !2, 'Formula'
         13        FETCH_OBJ_FUNC_ARG                               $15     $14, 'ducks'
         14        SEND_FUNC_ARG                                            $15
         15        DO_FCALL                                      0          
         16        ASSIGN                                                   !4, $13
   22    17        INIT_FCALL                                               'var_dump'
         18        FETCH_DIM_R                                      ~18     !2, 'Formula'
         19        FETCH_OBJ_R                                      ~19     ~18, 'ducks'
         20        SEND_VAL                                                 ~19
         21        INIT_METHOD_CALL                                         !4, 'next'
         22        DO_FCALL                                      0  $20     
         23        SEND_VAR                                                 $20
         24        DO_ICALL                                                 
         25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.29 ms | 1395 KiB | 17 Q