3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = <<<HTML <h2>Title of post</h2> 1 category <strong>task 1</strong> 1 category <strong>task 2</strong> 1 category <strong>task 3</strong>&nbsp; HTML; $dom=new DOMDocument; $dom->loadHTML($html); $xpath = new DOMXPath($dom); foreach ($xpath->query('//h2/following-sibling::text()') as $node) { var_export(trim($node->textContent)); echo "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 15, Position 2 = 25
Branch analysis from position: 15
2 jumps found. (Code = 78) Position 1 = 16, Position 2 = 25
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/5BIG4
function name:  (null)
number of ops:  27
compiled vars:  !0 = $html, !1 = $dom, !2 = $xpath, !3 = $node
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3Ch2%3ETitle+of+post%3C%2Fh2%3E+1+category+%3Cstrong%3Etask+1%3C%2Fstrong%3E+1+category+%3Cstrong%3Etask+2%3C%2Fstrong%3E+1+category+%3Cstrong%3Etask+3%3C%2Fstrong%3E%26nbsp%3B'
    6     1        NEW                                              $5      'DOMDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $5
    7     4        INIT_METHOD_CALL                                         !1, 'loadHTML'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
    8     7        NEW                                              $9      'DOMXPath'
          8        SEND_VAR_EX                                              !1
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !2, $9
    9    11        INIT_METHOD_CALL                                         !2, 'query'
         12        SEND_VAL_EX                                              '%2F%2Fh2%2Ffollowing-sibling%3A%3Atext%28%29'
         13        DO_FCALL                                      0  $12     
         14      > FE_RESET_R                                       $13     $12, ->25
         15    > > FE_FETCH_R                                               $13, !3, ->25
   10    16    >   INIT_FCALL                                               'var_export'
         17        INIT_FCALL                                               'trim'
         18        FETCH_OBJ_R                                      ~14     !3, 'textContent'
         19        SEND_VAL                                                 ~14
         20        DO_ICALL                                         $15     
         21        SEND_VAR                                                 $15
         22        DO_ICALL                                                 
   11    23        ECHO                                                     '%0A'
    9    24      > JMP                                                      ->15
         25    >   FE_FREE                                                  $13
   12    26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
127.99 ms | 1401 KiB | 17 Q