3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = '<img src="https://example.com/123456789/300.jpg?key=abcdefg" /> <img src="https://example.com/123456789/600.jpg?key=abcdefg" /> <img src="https://example.com/123456789/900.jpg?key=abcdefg" /> <img src="https://example.com/123456789/1200.jpg?key=abcdefg" />'; $dom = new DOMDocument; $dom->loadHTML($string); $images = $dom->getElementsByTagName('img'); foreach($images as $image) { if(strpos($image->getAttribute('src'), '600.jpg') != FALSE) { echo $image->getAttribute('src') . PHP_EOL; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 28
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 28
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 27
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 27
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
filename:       /in/IFok0
function name:  (null)
number of ops:  30
compiled vars:  !0 = $string, !1 = $dom, !2 = $images, !3 = $image
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3Cimg+src%3D%22https%3A%2F%2Fexample.com%2F123456789%2F300.jpg%3Fkey%3Dabcdefg%22+%2F%3E%0A%3Cimg+src%3D%22https%3A%2F%2Fexample.com%2F123456789%2F600.jpg%3Fkey%3Dabcdefg%22+%2F%3E%0A%3Cimg+src%3D%22https%3A%2F%2Fexample.com%2F123456789%2F900.jpg%3Fkey%3Dabcdefg%22+%2F%3E%0A%3Cimg+src%3D%22https%3A%2F%2Fexample.com%2F123456789%2F1200.jpg%3Fkey%3Dabcdefg%22+%2F%3E'
    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        INIT_METHOD_CALL                                         !1, 'getElementsByTagName'
          8        SEND_VAL_EX                                              'img'
          9        DO_FCALL                                      0  $9      
         10        ASSIGN                                                   !2, $9
    9    11      > FE_RESET_R                                       $11     !2, ->28
         12    > > FE_FETCH_R                                               $11, !3, ->28
   10    13    >   INIT_FCALL                                               'strpos'
         14        INIT_METHOD_CALL                                         !3, 'getAttribute'
         15        SEND_VAL_EX                                              'src'
         16        DO_FCALL                                      0  $12     
         17        SEND_VAR                                                 $12
         18        SEND_VAL                                                 '600.jpg'
         19        DO_ICALL                                         $13     
         20        BOOL                                             ~14     $13
         21      > JMPZ                                                     ~14, ->27
   11    22    >   INIT_METHOD_CALL                                         !3, 'getAttribute'
         23        SEND_VAL_EX                                              'src'
         24        DO_FCALL                                      0  $15     
         25        CONCAT                                           ~16     $15, '%0A'
         26        ECHO                                                     ~16
    9    27    > > JMP                                                      ->12
         28    >   FE_FREE                                                  $11
   13    29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.78 ms | 1003 KiB | 14 Q