3v4l.org

run code in 500+ PHP versions simultaneously
<?php $re = '/url(\(((?:[^()]+|(?1))+)\))/m'; $str = 'url(https://exemples.com/fonts/lato/lato/lato-regular-webfont.ttf) src:url(https://exemples.com/fonts/lato/lato-regular-webfont.eot?#iefix) background:url(https://exemples.com/product/header/img.png) background:url(/product/header/img.png) background:url("/product/header/img.png") background:url(\'/product/header/img.png\') background:url(/uploads/2019/03/0002-image(thumbnail_product).jpg) .card-thumb__img1{display:block;width:142px;height:62px;background:url(https://example.com/product01.jpg) center center no-repeat;background-size:contain}@media (max-width:1029px).card-thumb__img2{display:block;z-index:1;background:url(https://example.com/product02.jpg) center center no-repeat #000; background-image: url(/uploads/2019/03/product01-image(thumbnail_photo).jpg); '; preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0); foreach ($matches as $match) { if (preg_match('/^([\'"]?)[^"]+\1$/', $match[2])) { echo trim($match[2], "'\"") . PHP_EOL; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 19
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 19
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 18
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 18
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/OGaOq
function name:  (null)
number of ops:  21
compiled vars:  !0 = $re, !1 = $str, !2 = $matches, !3 = $match
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '%2Furl%28%5C%28%28%28%3F%3A%5B%5E%28%29%5D%2B%7C%28%3F1%29%29%2B%29%5C%29%29%2Fm'
    4     1        ASSIGN                                                       !1, 'url%28https%3A%2F%2Fexemples.com%2Ffonts%2Flato%2Flato%2Flato-regular-webfont.ttf%29%0Asrc%3Aurl%28https%3A%2F%2Fexemples.com%2Ffonts%2Flato%2Flato-regular-webfont.eot%3F%23iefix%29%0Abackground%3Aurl%28https%3A%2F%2Fexemples.com%2Fproduct%2Fheader%2Fimg.png%29%0Abackground%3Aurl%28%2Fproduct%2Fheader%2Fimg.png%29%0Abackground%3Aurl%28%22%2Fproduct%2Fheader%2Fimg.png%22%29%0Abackground%3Aurl%28%27%2Fproduct%2Fheader%2Fimg.png%27%29%0Abackground%3Aurl%28%2Fuploads%2F2019%2F03%2F0002-image%28thumbnail_product%29.jpg%29%0A%0A.card-thumb__img1%7Bdisplay%3Ablock%3Bwidth%3A142px%3Bheight%3A62px%3Bbackground%3Aurl%28https%3A%2F%2Fexample.com%2Fproduct01.jpg%29+center+center+no-repeat%3Bbackground-size%3Acontain%7D%40media+%28max-width%3A1029px%29.card-thumb__img2%7Bdisplay%3Ablock%3Bz-index%3A1%3Bbackground%3Aurl%28https%3A%2F%2Fexample.com%2Fproduct02.jpg%29+center+center+no-repeat+%23000%3B%0A%0Abackground-image%3A+url%28%2Fuploads%2F2019%2F03%2Fproduct01-image%28thumbnail_photo%29.jpg%29%3B+'
   16     2        INIT_FCALL                                                   'preg_match_all'
          3        SEND_VAR                                                     !0
          4        SEND_VAR                                                     !1
          5        SEND_REF                                                     !2
          6        SEND_VAL                                                     2
          7        SEND_VAL                                                     0
          8        DO_ICALL                                                     
   18     9      > FE_RESET_R                                           $7      !2, ->19
         10    > > FE_FETCH_R                                                   $7, !3, ->19
   19    11    >   FETCH_DIM_R                                          ~8      !3, 2
         12        FRAMELESS_ICALL_2                preg_match          ~9      '%2F%5E%28%5B%27%22%5D%3F%29%5B%5E%22%5D%2B%5C1%24%2F', ~8
         13      > JMPZ                                                         ~9, ->18
   20    14    >   FETCH_DIM_R                                          ~10     !3, 2
         15        FRAMELESS_ICALL_2                trim                ~11     ~10, '%27%22'
         16        CONCAT                                               ~12     ~11, '%0A'
         17        ECHO                                                         ~12
   18    18    > > JMP                                                          ->10
         19    >   FE_FREE                                                      $7
   22    20      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
160.11 ms | 2202 KiB | 14 Q