3v4l.org

run code in 300+ PHP versions simultaneously
<?php $doc = new DOMDocument(); $doc->loadXML('<products><item>A</item><item>B</item></products>'); $list = $doc->getElementsByTagName('item'); foreach($list as $item) { var_dump(get_class($item)); $itemValue = $item->nodeValue; var_dump(get_class($itemValue)); var_dump(method_exists($itemValue, '__toString')); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 30
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 30
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 30
filename:       /in/M45iA
function name:  (null)
number of ops:  32
compiled vars:  !0 = $doc, !1 = $list, !2 = $item, !3 = $itemValue
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $4      'DOMDocument'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $4
    4     3        INIT_METHOD_CALL                                         !0, 'loadXML'
          4        SEND_VAL_EX                                              '%3Cproducts%3E%3Citem%3EA%3C%2Fitem%3E%3Citem%3EB%3C%2Fitem%3E%3C%2Fproducts%3E'
          5        DO_FCALL                                      0          
    6     6        INIT_METHOD_CALL                                         !0, 'getElementsByTagName'
          7        SEND_VAL_EX                                              'item'
          8        DO_FCALL                                      0  $8      
          9        ASSIGN                                                   !1, $8
    8    10      > FE_RESET_R                                       $10     !1, ->30
         11    > > FE_FETCH_R                                               $10, !2, ->30
    9    12    >   INIT_FCALL                                               'var_dump'
         13        GET_CLASS                                        ~11     !2
         14        SEND_VAL                                                 ~11
         15        DO_ICALL                                                 
   10    16        FETCH_OBJ_R                                      ~13     !2, 'nodeValue'
         17        ASSIGN                                                   !3, ~13
   12    18        INIT_FCALL                                               'var_dump'
         19        GET_CLASS                                        ~15     !3
         20        SEND_VAL                                                 ~15
         21        DO_ICALL                                                 
   13    22        INIT_FCALL                                               'var_dump'
         23        INIT_FCALL                                               'method_exists'
         24        SEND_VAR                                                 !3
         25        SEND_VAL                                                 '__toString'
         26        DO_ICALL                                         $17     
         27        SEND_VAR                                                 $17
         28        DO_ICALL                                                 
    8    29      > JMP                                                      ->11
         30    >   FE_FREE                                                  $10
   14    31      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.03 ms | 1396 KiB | 17 Q