3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = <<<HTML <a class="c-shadow" href="some-random-link">text 1</a> <a class="c-shadow" href="some-random-link">text 2</a> <a class="c-shadow" href="some-random-link">text 3</a> <a class="c-shadow" href="some-random-link">text 4</a> <a class="c-shadow" href="some-random-link">text 5</a> HTML; $dom=new DOMDocument; $dom->loadHTML($html); $xpath = new DOMXPath($dom); foreach ($xpath->evaluate("//a[@class='c-shadow']") as $node) { $result[]=$node->nodeValue; } var_export($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 15, Position 2 = 20
Branch analysis from position: 15
2 jumps found. (Code = 78) Position 1 = 16, Position 2 = 20
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/cn9p1
function name:  (null)
number of ops:  25
compiled vars:  !0 = $html, !1 = $dom, !2 = $xpath, !3 = $node, !4 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3Ca+class%3D%22c-shadow%22+href%3D%22some-random-link%22%3Etext+1%3C%2Fa%3E%0A%3Ca+class%3D%22c-shadow%22+href%3D%22some-random-link%22%3Etext+2%3C%2Fa%3E%0A%3Ca+class%3D%22c-shadow%22+href%3D%22some-random-link%22%3Etext+3%3C%2Fa%3E%0A%3Ca+class%3D%22c-shadow%22+href%3D%22some-random-link%22%3Etext+4%3C%2Fa%3E%0A%3Ca+class%3D%22c-shadow%22+href%3D%22some-random-link%22%3Etext+5%3C%2Fa%3E'
   10     1        NEW                                              $6      'DOMDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $6
   11     4        INIT_METHOD_CALL                                         !1, 'loadHTML'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
   12     7        NEW                                              $10     'DOMXPath'
          8        SEND_VAR_EX                                              !1
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !2, $10
   13    11        INIT_METHOD_CALL                                         !2, 'evaluate'
         12        SEND_VAL_EX                                              '%2F%2Fa%5B%40class%3D%27c-shadow%27%5D'
         13        DO_FCALL                                      0  $13     
         14      > FE_RESET_R                                       $14     $13, ->20
         15    > > FE_FETCH_R                                               $14, !3, ->20
   14    16    >   FETCH_OBJ_R                                      ~16     !3, 'nodeValue'
         17        ASSIGN_DIM                                               !4
         18        OP_DATA                                                  ~16
   13    19      > JMP                                                      ->15
         20    >   FE_FREE                                                  $14
   16    21        INIT_FCALL                                               'var_export'
         22        SEND_VAR                                                 !4
         23        DO_ICALL                                                 
         24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.71 ms | 1011 KiB | 14 Q