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>test2</duck> <duck>test3</duck> </ducks> <cereal>2</cereal> </Formula> </root>'; $xml = simplexml_load_string($s); $arr = (array) $xml; $newArr = (array)$arr['Formula']; var_dump($newArr['ducks'], $arr['Formula']->ducks);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/l8l0W
function name:  (null)
number of ops:  18
compiled vars:  !0 = $s, !1 = $xml, !2 = $arr, !3 = $newArr
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%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                                         $5      
          4        ASSIGN                                                   !1, $5
   19     5        CAST                                          7  ~7      !1
          6        ASSIGN                                                   !2, ~7
   20     7        FETCH_DIM_R                                      ~9      !2, 'Formula'
          8        CAST                                          7  ~10     ~9
          9        ASSIGN                                                   !3, ~10
   21    10        INIT_FCALL                                               'var_dump'
         11        FETCH_DIM_R                                      ~12     !3, 'ducks'
         12        SEND_VAL                                                 ~12
         13        FETCH_DIM_R                                      ~13     !2, 'Formula'
         14        FETCH_OBJ_R                                      ~14     ~13, 'ducks'
         15        SEND_VAL                                                 ~14
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.97 ms | 1386 KiB | 17 Q