3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Everything you enter here will be executed by our servers. Try it! $dirnameCss = 'amoi'; $content = "url('../../toto.jpg');"; $match = ''; $content = preg_match('/url\(("|\')?\.\//', $match); print_r($match); $content = preg_replace('/url\(("|\')?\.\//', 'url(\\1', $content); $content = preg_replace('/url\(("|\')?(?!(\'|"|)http)(?!(\'|"|)data)([^\/])/', 'url(\\1' . $dirnameCss . '/\\4', $content); echo $content;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tgRF0
function name:  (null)
number of ops:  27
compiled vars:  !0 = $dirnameCss, !1 = $content, !2 = $match
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 'amoi'
    5     1        ASSIGN                                                   !1, 'url%28%27..%2F..%2Ftoto.jpg%27%29%3B'
    6     2        ASSIGN                                                   !2, ''
    7     3        INIT_FCALL                                               'preg_match'
          4        SEND_VAL                                                 '%2Furl%5C%28%28%22%7C%27%29%3F%5C.%5C%2F%2F'
          5        SEND_VAR                                                 !2
          6        DO_ICALL                                         $6      
          7        ASSIGN                                                   !1, $6
    8     8        INIT_FCALL                                               'print_r'
          9        SEND_VAR                                                 !2
         10        DO_ICALL                                                 
    9    11        INIT_FCALL                                               'preg_replace'
         12        SEND_VAL                                                 '%2Furl%5C%28%28%22%7C%27%29%3F%5C.%5C%2F%2F'
         13        SEND_VAL                                                 'url%28%5C1'
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                         $9      
         16        ASSIGN                                                   !1, $9
   10    17        INIT_FCALL                                               'preg_replace'
         18        SEND_VAL                                                 '%2Furl%5C%28%28%22%7C%27%29%3F%28%3F%21%28%27%7C%22%7C%29http%29%28%3F%21%28%27%7C%22%7C%29data%29%28%5B%5E%5C%2F%5D%29%2F'
   11    19        CONCAT                                           ~11     'url%28%5C1', !0
         20        CONCAT                                           ~12     ~11, '%2F%5C4'
         21        SEND_VAL                                                 ~12
         22        SEND_VAR                                                 !1
         23        DO_ICALL                                         $13     
   10    24        ASSIGN                                                   !1, $13
   12    25        ECHO                                                     !1
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.91 ms | 1395 KiB | 19 Q