3v4l.org

run code in 500+ PHP versions simultaneously
<?php $string = 'Ut quo totam aperiam possimus recusandae <img src="mylink.jpg"/> Bo nostrum vero distinctio eligendi. <img src="mylinktmpfileandsomeotherstuff.jpg"/> <img src="myotherlink.jpg"/> Lorem ipsum'; $dom = new DomDocument(); $dom->loadHTML($string); $xpath = new DOMXpath($dom); foreach($xpath->query("//img[contains(@src, 'tmpfile')]") as $elm) { echo $elm->getAttribute("src") . PHP_EOL; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 15, Position 2 = 22
Branch analysis from position: 15
2 jumps found. (Code = 78) Position 1 = 16, Position 2 = 22
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/cRnSY
function name:  (null)
number of ops:  24
compiled vars:  !0 = $string, !1 = $dom, !2 = $xpath, !3 = $elm
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, 'Ut+quo+totam+aperiam+possimus+recusandae%0A%3Cimg+src%3D%22mylink.jpg%22%2F%3E%0ABo+nostrum+vero+distinctio+eligendi.%0A%3Cimg+src%3D%22mylinktmpfileandsomeotherstuff.jpg%22%2F%3E%0A%3Cimg+src%3D%22myotherlink.jpg%22%2F%3E%0ALorem+ipsum'
   10     1        NEW                                                  $5      'DomDocument'
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !1, $5
   11     4        INIT_METHOD_CALL                                             !1, 'loadHTML'
          5        SEND_VAR_EX                                                  !0
          6        DO_FCALL                                          0          
   12     7        NEW                                                  $9      'DOMXpath'
          8        SEND_VAR_EX                                                  !1
          9        DO_FCALL                                          0          
         10        ASSIGN                                                       !2, $9
   13    11        INIT_METHOD_CALL                                             !2, 'query'
         12        SEND_VAL_EX                                                  '%2F%2Fimg%5Bcontains%28%40src%2C+%27tmpfile%27%29%5D'
         13        DO_FCALL                                          0  $12     
         14      > FE_RESET_R                                           $13     $12, ->22
         15    > > FE_FETCH_R                                                   $13, !3, ->22
   14    16    >   INIT_METHOD_CALL                                             !3, 'getAttribute'
         17        SEND_VAL_EX                                                  'src'
         18        DO_FCALL                                          0  $14     
         19        CONCAT                                               ~15     $14, '%0A'
         20        ECHO                                                         ~15
   13    21      > JMP                                                          ->15
         22    >   FE_FREE                                                      $13
   15    23      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
170.1 ms | 2022 KiB | 13 Q