3v4l.org

run code in 500+ PHP versions simultaneously
<?php $doc = Dom\HTMLDocument::createFromString( '<!DOCTYPE html><p class="a b">one</p><p class="b">two</p>' ); foreach (['.a, .b', '.a, .b, .a.b', ':is(.a, .b)'] as $selector) { $texts = []; foreach ($doc->querySelectorAll($selector) as $element) { $texts[] = $element->textContent; } echo $selector, ' => ', implode(' ', $texts), "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 23
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 23
Branch analysis from position: 6
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 16
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 16
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 16
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
filename:       /in/11SH2
function name:  (null)
number of ops:  25
compiled vars:  !0 = $doc, !1 = $selector, !2 = $texts, !3 = $element
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   INIT_STATIC_METHOD_CALL                                      'Dom%5CHTMLDocument', 'createFromString'
    4     1        SEND_VAL                                                     '%3C%21DOCTYPE+html%3E%3Cp+class%3D%22a+b%22%3Eone%3C%2Fp%3E%3Cp+class%3D%22b%22%3Etwo%3C%2Fp%3E'
    3     2        DO_FCALL                                          0  $4      
          3        ASSIGN                                                       !0, $4
    7     4      > FE_RESET_R                                           $6      <array>, ->23
          5    > > FE_FETCH_R                                                   $6, !1, ->23
    8     6    >   ASSIGN                                                       !2, <array>
    9     7        INIT_METHOD_CALL                                             !0, 'querySelectorAll'
          8        SEND_VAR_EX                                                  !1
          9        DO_FCALL                                          0  $8      
         10      > FE_RESET_R                                           $9      $8, ->16
         11    > > FE_FETCH_R                                                   $9, !3, ->16
   10    12    >   FETCH_OBJ_R                                          ~11     !3, 'textContent'
         13        ASSIGN_DIM                                                   !2
         14        OP_DATA                                                      ~11
    9    15      > JMP                                                          ->11
         16    >   FE_FREE                                                      $9
   12    17        ECHO                                                         !1
         18        ECHO                                                         '+%3D%3E+'
         19        FRAMELESS_ICALL_2                implode             ~12     '+', !2
         20        ECHO                                                         ~12
         21        ECHO                                                         '%0A'
    7    22      > JMP                                                          ->5
         23    >   FE_FREE                                                      $6
   13    24      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
125.73 ms | 476 KiB | 7 Q