3v4l.org

run code in 300+ PHP versions simultaneously
<?php $bigKml = "<br><img src='files/bagel.png'><br><br>"; $imgPattern = "/<img src=.*?>/"; preg_match($imgPattern, $bigKml, $imageTags); print_r($imageTags); foreach($imageTags as $imageTag) { $urlPattern = "/'([^']*)'/"; preg_match($urlPattern, $imageTag, $oldUrls); $oldUrl = $oldUrls[1]; //the second element contains the match without the quotes print_r($oldUrl); $newUrl = "/var/www/resources/" + $oldUrl; } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 26
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 26
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
filename:       /in/qJFK8
function name:  (null)
number of ops:  28
compiled vars:  !0 = $bigKml, !1 = $imgPattern, !2 = $imageTags, !3 = $imageTag, !4 = $urlPattern, !5 = $oldUrls, !6 = $oldUrl, !7 = $newUrl
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3Cbr%3E%3Cimg+src%3D%27files%2Fbagel.png%27%3E%3Cbr%3E%3Cbr%3E'
    6     1        ASSIGN                                                   !1, '%2F%3Cimg+src%3D.%2A%3F%3E%2F'
    7     2        INIT_FCALL                                               'preg_match'
          3        SEND_VAR                                                 !1
          4        SEND_VAR                                                 !0
          5        SEND_REF                                                 !2
          6        DO_ICALL                                                 
    8     7        INIT_FCALL                                               'print_r'
          8        SEND_VAR                                                 !2
          9        DO_ICALL                                                 
   10    10      > FE_RESET_R                                       $12     !2, ->26
         11    > > FE_FETCH_R                                               $12, !3, ->26
   11    12    >   ASSIGN                                                   !4, '%2F%27%28%5B%5E%27%5D%2A%29%27%2F'
   12    13        INIT_FCALL                                               'preg_match'
         14        SEND_VAR                                                 !4
         15        SEND_VAR                                                 !3
         16        SEND_REF                                                 !5
         17        DO_ICALL                                                 
   13    18        FETCH_DIM_R                                      ~15     !5, 1
         19        ASSIGN                                                   !6, ~15
   14    20        INIT_FCALL                                               'print_r'
         21        SEND_VAR                                                 !6
         22        DO_ICALL                                                 
   15    23        ADD                                              ~18     '%2Fvar%2Fwww%2Fresources%2F', !6
         24        ASSIGN                                                   !7, ~18
   10    25      > JMP                                                      ->11
         26    >   FE_FREE                                                  $12
   17    27      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.65 ms | 1388 KiB | 17 Q