3v4l.org

run code in 500+ PHP versions simultaneously
<?php $dom=new DOMDocument; $dom->loadHTML(<<<HTML <div> <a>abc</a> xyz </div> HTML ); $div=$dom->getElementsByTagName("div")->item(0); var_dump($div->childNodes->length);//just to debug $txt=""; foreach(range(0,$div->childNodes->length-1) as $idx) { if($div->childNodes->item($idx)->nodeType==3) { $txt.=$div->childNodes->item($idx)->nodeValue; } } var_dump($txt);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 27, Position 2 = 42
Branch analysis from position: 27
2 jumps found. (Code = 78) Position 1 = 28, Position 2 = 42
Branch analysis from position: 28
2 jumps found. (Code = 43) Position 1 = 35, Position 2 = 41
Branch analysis from position: 35
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
Branch analysis from position: 41
Branch analysis from position: 42
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 42
filename:       /in/Flo0u
function name:  (null)
number of ops:  47
compiled vars:  !0 = $dom, !1 = $div, !2 = $txt, !3 = $idx
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   NEW                                                  $4      'DOMDocument'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $4
    3     3        INIT_METHOD_CALL                                             !0, 'loadHTML'
    4     4        SEND_VAL_EX                                                  '%3Cdiv%3E%0A+++++%3Ca%3Eabc%3C%2Fa%3E%0A+++++xyz%0A%3C%2Fdiv%3E'
    3     5        DO_FCALL                                          0          
   10     6        INIT_METHOD_CALL                                             !0, 'getElementsByTagName'
          7        SEND_VAL_EX                                                  'div'
          8        DO_FCALL                                          0  $8      
          9        INIT_METHOD_CALL                                             $8, 'item'
         10        SEND_VAL_EX                                                  0
         11        DO_FCALL                                          0  $9      
         12        ASSIGN                                                       !1, $9
   11    13        INIT_FCALL                                                   'var_dump'
         14        FETCH_OBJ_R                                          ~11     !1, 'childNodes'
         15        FETCH_OBJ_R                                          ~12     ~11, 'length'
         16        SEND_VAL                                                     ~12
         17        DO_ICALL                                                     
   12    18        ASSIGN                                                       !2, ''
   13    19        INIT_FCALL                                                   'range'
         20        SEND_VAL                                                     0
         21        FETCH_OBJ_R                                          ~15     !1, 'childNodes'
         22        FETCH_OBJ_R                                          ~16     ~15, 'length'
         23        SUB                                                  ~17     ~16, 1
         24        SEND_VAL                                                     ~17
         25        DO_ICALL                                             $18     
         26      > FE_RESET_R                                           $19     $18, ->42
         27    > > FE_FETCH_R                                                   $19, !3, ->42
   15    28    >   FETCH_OBJ_R                                          ~20     !1, 'childNodes'
         29        INIT_METHOD_CALL                                             ~20, 'item'
         30        SEND_VAR_EX                                                  !3
         31        DO_FCALL                                          0  $21     
         32        FETCH_OBJ_R                                          ~22     $21, 'nodeType'
         33        IS_EQUAL                                                     ~22, 3
         34      > JMPZ                                                         ~23, ->41
   17    35    >   FETCH_OBJ_R                                          ~24     !1, 'childNodes'
         36        INIT_METHOD_CALL                                             ~24, 'item'
         37        SEND_VAR_EX                                                  !3
         38        DO_FCALL                                          0  $25     
         39        FETCH_OBJ_R                                          ~26     $25, 'nodeValue'
         40        ASSIGN_OP                                         8          !2, ~26
   13    41    > > JMP                                                          ->27
         42    >   FE_FREE                                                      $19
   20    43        INIT_FCALL                                                   'var_dump'
         44        SEND_VAR                                                     !2
         45        DO_ICALL                                                     
         46      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
163.36 ms | 2689 KiB | 15 Q