3v4l.org

run code in 300+ PHP versions simultaneously
<?php function proxifyCSS($css, $baseURL) { return preg_replace_callback( '/url\((.*?)\)/i', function($matches) use ($baseURL) { $url = $matches[1]; //Remove any surrounding single or double quotes from the URL so it can be passed to rel2abs - the quotes are optional in CSS //Assume that if there is a leading quote then there should be a trailing quote, so just use trim() to remove them if (strpos($url, "'") === 0) { $url = trim($url, "'"); } if (strpos($url, "\"") === 0) { $url = trim($url, "\""); } if (stripos($url, "data:") === 0) return "url(" . $url . ")"; //The URL isn't an HTTP URL but is actual binary data. Don't proxify it. return "url(" . PROXY_PREFIX . rel2abs($url, $baseURL) . ")"; }, $css); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Rp5gG
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E > > RETURN                                                   1

Function proxifycss:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Rp5gG
function name:  proxifyCSS
number of ops:  11
compiled vars:  !0 = $css, !1 = $baseURL
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        INIT_FCALL                                               'preg_replace_callback'
    5     3        SEND_VAL                                                 '%2Furl%5C%28%28.%2A%3F%29%5C%29%2Fi'
    6     4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FRp5gG%3A6%240'
          5        BIND_LEXICAL                                             ~2, !1
   18     6        SEND_VAL                                                 ~2
   19     7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $3      
          9      > RETURN                                                   $3
   20    10*     > RETURN                                                   null

End of function proxifycss

Function %00%7Bclosure%7D%2Fin%2FRp5gG%3A6%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 15
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 26
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 32, Position 2 = 35
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
Branch analysis from position: 15
filename:       /in/Rp5gG
function name:  {closure}
number of ops:  45
compiled vars:  !0 = $matches, !1 = $baseURL, !2 = $url
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
    7     2        FETCH_DIM_R                                      ~3      !0, 1
          3        ASSIGN                                                   !2, ~3
   10     4        INIT_FCALL                                               'strpos'
          5        SEND_VAR                                                 !2
          6        SEND_VAL                                                 '%27'
          7        DO_ICALL                                         $5      
          8        IS_IDENTICAL                                             $5, 0
          9      > JMPZ                                                     ~6, ->15
   11    10    >   INIT_FCALL                                               'trim'
         11        SEND_VAR                                                 !2
         12        SEND_VAL                                                 '%27'
         13        DO_ICALL                                         $7      
         14        ASSIGN                                                   !2, $7
   13    15    >   INIT_FCALL                                               'strpos'
         16        SEND_VAR                                                 !2
         17        SEND_VAL                                                 '%22'
         18        DO_ICALL                                         $9      
         19        IS_IDENTICAL                                             $9, 0
         20      > JMPZ                                                     ~10, ->26
   14    21    >   INIT_FCALL                                               'trim'
         22        SEND_VAR                                                 !2
         23        SEND_VAL                                                 '%22'
         24        DO_ICALL                                         $11     
         25        ASSIGN                                                   !2, $11
   16    26    >   INIT_FCALL                                               'stripos'
         27        SEND_VAR                                                 !2
         28        SEND_VAL                                                 'data%3A'
         29        DO_ICALL                                         $13     
         30        IS_IDENTICAL                                             $13, 0
         31      > JMPZ                                                     ~14, ->35
         32    >   CONCAT                                           ~15     'url%28', !2
         33        CONCAT                                           ~16     ~15, '%29'
         34      > RETURN                                                   ~16
   17    35    >   FETCH_CONSTANT                                   ~17     'PROXY_PREFIX'
         36        CONCAT                                           ~18     'url%28', ~17
         37        INIT_FCALL_BY_NAME                                       'rel2abs'
         38        SEND_VAR_EX                                              !2
         39        SEND_VAR_EX                                              !1
         40        DO_FCALL                                      0  $19     
         41        CONCAT                                           ~20     ~18, $19
         42        CONCAT                                           ~21     ~20, '%29'
         43      > RETURN                                                   ~21
   18    44*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FRp5gG%3A6%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.76 ms | 1400 KiB | 21 Q