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( $txt, 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 = 20, Position 2 = 26
Branch analysis from position: 20
2 jumps found. (Code = 78) Position 1 = 21, Position 2 = 26
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
filename:       /in/bRekq
function name:  (null)
number of ops:  28
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        SEND_VAR_EX                                              !0
          9        SEND_VAL_EX                                              8196
         10        DO_FCALL                                      0          
   33    11        NEW                                              $12     'DOMXpath'
         12        SEND_VAR_EX                                              !1
         13        DO_FCALL                                      0          
         14        ASSIGN                                                   !2, $12
   34    15        INIT_METHOD_CALL                                         !2, 'query'
         16        SEND_VAL_EX                                              '%2F%2A%2F%2A'
         17        DO_FCALL                                      0  $15     
         18        ASSIGN                                                   !3, $15
   35    19      > FE_RESET_R                                       $17     !3, ->26
         20    > > FE_FETCH_R                                       ~18     $17, !4, ->26
         21    >   ASSIGN                                                   !5, ~18
         22        FETCH_OBJ_R                                      ~20     !4, 'nodeName'
         23        CONCAT                                           ~21     ~20, '%0A'
         24        ECHO                                                     ~21
         25      > JMP                                                      ->20
         26    >   FE_FREE                                                  $17
         27      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.29 ms | 1401 KiB | 15 Q