3v4l.org

run code in 300+ PHP versions simultaneously
<?php $txt = <<<EOT <p>The breed was first...</p> <p>Semencic credits his...</p> <h1>Appearance</h1> <p>The breed's distinctive...</p> <p>It should be symmetrical...</p> <figure id="attachment_6" style="width: 840px" class="wp-caption alignnone"> <img class="size-large wp-image-6" src="...jpg" alt="boerboel appearance" width="840" height="746"> <figcaption class="wp-caption-text">The dog appearance.</figcaption> </figure> <h1>Requirements</h1> <p>Prospective owners....</p> <p>These dogs....</p> <h2>A Little Warning!</h2> <p>If you are considering...</p> <blockquote> <p>According to...</p> <p>Source: http://...</p> </blockquote> <p>Although more suitable...</p> EOT; $doc = new DOMDocument(); libxml_use_internal_errors(1); $doc->loadHTML( "<body>$txt</body>", LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD ); $xpath = new DOMXpath( $doc ); $nodes = $xpath->query( "/*/*" ); foreach( $nodes as $key => $node ) echo $node->nodeName . PHP_EOL;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 23, Position 2 = 29
Branch analysis from position: 23
2 jumps found. (Code = 78) Position 1 = 24, Position 2 = 29
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
filename:       /in/NCP9e
function name:  (null)
number of ops:  31
compiled vars:  !0 = $txt, !1 = $doc, !2 = $xpath, !3 = $nodes, !4 = $node, !5 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3Cp%3EThe+breed+was+first...%3C%2Fp%3E%0A%3Cp%3ESemencic+credits+his...%3C%2Fp%3E%0A%0A%3Ch1%3EAppearance%3C%2Fh1%3E%0A%3Cp%3EThe+breed%27s+distinctive...%3C%2Fp%3E%0A%3Cp%3EIt+should+be+symmetrical...%3C%2Fp%3E%0A%0A%3Cfigure+id%3D%22attachment_6%22+style%3D%22width%3A+840px%22+class%3D%22wp-caption+alignnone%22%3E%0A++++%3Cimg+class%3D%22size-large+wp-image-6%22+src%3D%22...jpg%22+alt%3D%22boerboel+appearance%22+width%3D%22840%22+height%3D%22746%22%3E%0A++++%3Cfigcaption+class%3D%22wp-caption-text%22%3EThe+dog+appearance.%3C%2Ffigcaption%3E%0A%3C%2Ffigure%3E%0A%0A%3Ch1%3ERequirements%3C%2Fh1%3E%0A%3Cp%3EProspective+owners....%3C%2Fp%3E%0A%3Cp%3EThese+dogs....%3C%2Fp%3E%0A%0A%3Ch2%3EA+Little+Warning%21%3C%2Fh2%3E%0A%3Cp%3EIf+you+are+considering...%3C%2Fp%3E%0A%3Cblockquote%3E%0A++++%3Cp%3EAccording+to...%3C%2Fp%3E%0A++++%3Cp%3ESource%3A+http%3A%2F%2F...%3C%2Fp%3E%0A%3C%2Fblockquote%3E%0A%3Cp%3EAlthough+more+suitable...%3C%2Fp%3E'
   29     1        NEW                                              $7      'DOMDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $7
   30     4        INIT_FCALL                                               'libxml_use_internal_errors'
          5        SEND_VAL                                                 1
          6        DO_ICALL                                                 
   31     7        INIT_METHOD_CALL                                         !1, 'loadHTML'
          8        ROPE_INIT                                     3  ~12     '%3Cbody%3E'
          9        ROPE_ADD                                      1  ~12     ~12, !0
         10        ROPE_END                                      2  ~11     ~12, '%3C%2Fbody%3E'
         11        SEND_VAL_EX                                              ~11
         12        SEND_VAL_EX                                              8196
         13        DO_FCALL                                      0          
   33    14        NEW                                              $15     'DOMXpath'
         15        SEND_VAR_EX                                              !1
         16        DO_FCALL                                      0          
         17        ASSIGN                                                   !2, $15
   34    18        INIT_METHOD_CALL                                         !2, 'query'
         19        SEND_VAL_EX                                              '%2F%2A%2F%2A'
         20        DO_FCALL                                      0  $18     
         21        ASSIGN                                                   !3, $18
   35    22      > FE_RESET_R                                       $20     !3, ->29
         23    > > FE_FETCH_R                                       ~21     $20, !4, ->29
         24    >   ASSIGN                                                   !5, ~21
         25        FETCH_OBJ_R                                      ~23     !4, 'nodeName'
         26        CONCAT                                           ~24     ~23, '%0A'
         27        ECHO                                                     ~24
         28      > JMP                                                      ->23
         29    >   FE_FREE                                                  $20
         30      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.61 ms | 1015 KiB | 14 Q