3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = '<items><item/><item/><item/></items>'; $dom = new DOMDocument(); $dom->loadXml($xml); $array = iterator_to_array($dom->documentElement->childNodes); var_dump(count($array));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QSMeY
function name:  (null)
number of ops:  18
compiled vars:  !0 = $xml, !1 = $dom, !2 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3Citems%3E%3Citem%2F%3E%3Citem%2F%3E%3Citem%2F%3E%3C%2Fitems%3E'
    5     1        NEW                                              $4      'DOMDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $4
    6     4        INIT_METHOD_CALL                                         !1, 'loadXml'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
    7     7        INIT_FCALL                                               'iterator_to_array'
          8        FETCH_OBJ_R                                      ~8      !1, 'documentElement'
          9        FETCH_OBJ_R                                      ~9      ~8, 'childNodes'
         10        SEND_VAL                                                 ~9
         11        DO_ICALL                                         $10     
         12        ASSIGN                                                   !2, $10
    9    13        INIT_FCALL                                               'var_dump'
         14        COUNT                                            ~12     !2
         15        SEND_VAL                                                 ~12
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.94 ms | 1386 KiB | 17 Q