3v4l.org

run code in 300+ PHP versions simultaneously
<?php function parseCSS($rawText) { $matches = array(); $selections = preg_match_all('/\/\* customize_(.+?) \*\/(.+?)\/\* customize_\1 \*\//s',$rawText,$matches); if (!$selections) return array(); $realMatches = array(); foreach($matches[1] as $key => $val) { $elements = array(); $realMatches[$val] = array(); preg_match_all('/([a-z\-]+?)[\s\t]*:(.+?);/s',$matches[2][$key],$elements); foreach ($elements[1] as $k => $v) { $realMatches[$val][] = array($v,trim($elements[2][$k])); } } return $realMatches; } function replaceTokensWithMap($map,$input) { foreach ($map as $key => $tokens) { $css = ""; foreach ($tokens as $token) { $css .= implode(':',$token).";"; } $input = preg_replace("/\/\* customize_$key \*\/.+?\/\* customize_$key \*\//",$css,$input); } return $input; } $css = ' /* colors * 73880b dark green * f4ffd2 light green * 69ab2b bright green (links & headers) * daf095 med green sidebar backgrounds, header nav * 50AAB5 blue for hovers.. */ /* HTML Tag Redefinition */ html, body { height: 100%; font-family:Arial, Helvetica, sans-serif; } body { padding: 0px; margin: 0px; background: #fff url(images/footer_grass.jpg) repeat-x fixed left bottom; } img { border: 0px } a { cursor:pointer } /* Page Structure / Navigation */ #page { width:800px; margin: auto; background-color:#f4ffd2; height: auto !important; height:100%; min-height:100%; position:relative; background:url(images/central_columns_bg.jpg) repeat-y top left; } #page.sidebar-left { background:url(images/central_left_columns_bg.jpg) repeat-y top left; } #page #header { position:relative; height:100px; background: url(images/header_bg.jpg) repeat-x top left #73880b; padding:15px; } #page #header #logo { color:#fff; font-size:32px; line-height: auto; padding: 0px; margin:0; cursor:pointer; position:absolute; bottom:15px; left: 15px; width:308px; overflow:visible; } #page #header #logo a { /* customize_header_logo */ color: #ffffff; /* customize_header_logo */ /* customize_header_logo_text */ font: normal bold 32px Arial; /* customize_header_logo_text */ text-decoration:none; } #page #header #logo p{ display:inline; line-height:inherit; font-size:inherit; padding:inherit; margin:inherit; color:inherit } #page #header ul.nav-header { list-style:none; margin:0px; float: right; padding:0px; z-index:2; overflow:visible; } #page #header ul.nav-header li { float:left; padding:2px 0px; margin-left:24px; margin-bottom: 0px; /* customize_header_link_text */ color:#daf095; /* customize_header_link_text */ font-size:14px; letter-spacing:1.5px; margin-top:0px } #page #header ul.nav-header li a, #page #header ul.nav-header li a:hover { text-decoration:none; color:#daf095 } #page #header ul.nav-header li.nav-selected { font-weight:bold; } /* #page #header #header-area { position:relative; height:75px; } */ #page #header #header-area { position: absolute; bottom: 15px; right: 15px; width: 462px; } #page #homeHeader { background: url(images/home_header.jpg) top left no-repeat; min-height:192px; } #page #homeHeader, #page #pageHeader { margin:0; padding:0; position:relative; } #page #central { clear:both; padding-bottom:30px; /* for footer */ } #page.no-sidebar { background-image: none !important; background-color:#f4ffd2; } /* body & sidebar */ #page #central #body { float:left; text-align:left; width:542px; padding:15px; /* customize_background */ background-color:"#f4ffd2"; border-color : red; /* customize_background */ } #page #central #sidebar { float:right; width:198px; padding:15px 15px 30px 15px; background: #daf095; } #page.sidebar-left #central #sidebar { float:left; width: 94px } #page.sidebar-left #central #body { float:right; width: 646px; padding: 15px; } #page.no-sidebar #body { float: none !important; width: auto !important } #page #central #sidebar p { line-height:24px } #page #central #sidebar ul.nav { list-style:none; margin-left:0px; padding:0px; padding-left:0; font-size:11px; } #page #central #sidebar ul.nav li { margin-bottom:10px; } #page #central #sidebar ul.nav a { text-decoration:none; color:#69ab2b } #page #central #sidebar ul.nav a.nav-selected { font-weight: bold } #page #central #sidebar ul.nav a:hover { text-decoration:underline } #page #central #sidebar ul.nav ul { list-style:none; margin-left:5px; padding:0px; margin-top:10px; } #page #central #sidebar ul.nav ul li { padding-left: 5px; margin: 0; border-left: 1px solid #69ab2b; } #page #central #sidebar ul.nav ul li ul li { list-style:square inside; padding-left:0; } #page #central #sidebar ul.nav ul li ul li { border:none; } #page #footer { height:10px; line-height:10px; background:url(images/footer_bg.jpg) repeat-x; clear:both; color:#daf095; font-size:10px; text-align:center; padding:10px 0 10px 0; position:absolute; bottom:0; width:100% } #page #footer a { color:#daf095; text-decoration:none; } span.sign-in {margin-left: 20px} #page #footer span.powered-by { float:right; margin-right:20px;} /* MISC STYLES & SHORTCUTS */ div.code { border: 1px solid #ddd; background: #eee; padding: 10px } div.spacer, div.ccm-spacer { clear:both; font-size:1px; line-height:1px } .noTopSpace { margin-top:0px; padding-top:0px } /* customize_miscellaneous */ /* customize_miscellaneous */'; echo replaceTokensWithMap(parseCSS($css),$css);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iPKTu
function name:  (null)
number of ops:  10
compiled vars:  !0 = $css
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   32     0  E >   ASSIGN                                                   !0, '%0A%2F%2A+colors+%0A+%2A+73880b+dark+green%0A+%2A+f4ffd2+light+green%0A+%2A+69ab2b+bright+green+%28links+%26+headers%29%0A+%2A+daf095+med+green+sidebar+backgrounds%2C+header+nav%0A+%2A+50AAB5+blue+for+hovers..%0A%2A%2F%0A%0A%2F%2A+HTML+Tag+Redefinition+%2A%2F%0Ahtml%2C+body+%7B%0A%09height%3A+100%25%3B%0A%09font-family%3AArial%2C+Helvetica%2C+sans-serif%3B%0A%7D%0Abody+%7B%0A%09padding%3A+0px%3B%0A%09margin%3A+0px%3B%0A%09background%3A+%23fff+url%28images%2Ffooter_grass.jpg%29+repeat-x+fixed+left+bottom%3B%0A%7D%0Aimg+%7B%0A%09border%3A+0px%0A%7D%0Aa+%7B+cursor%3Apointer+%7D%0A%2F%2A+Page+Structure+%2F+Navigation+%2A%2F%0A%23page+%7B%0A%09width%3A800px%3B%0A%09margin%3A+auto%3B%0A%09background-color%3A%23f4ffd2%3B%0A%09height%3A+auto+%21important%3B%0A%09height%3A100%25%3B%0A%09min-height%3A100%25%3B%0A%09position%3Arelative%3B%0A%09background%3Aurl%28images%2Fcentral_columns_bg.jpg%29+repeat-y+top+left%3B%0A%7D%0A%23page.sidebar-left+%7B%0A%09background%3Aurl%28images%2Fcentral_left_columns_bg.jpg%29+repeat-y+top+left%3B%0A%7D%0A%23page+%23header+%7B%0A%09position%3Arelative%3B%0A%09height%3A100px%3B%0A%09background%3A+url%28images%2Fheader_bg.jpg%29+repeat-x+top+left+%2373880b%3B%0A%09padding%3A15px%3B%0A%7D%0A%23page+%23header+%23logo+%7B%0A%09color%3A%23fff%3B%0A%09font-size%3A32px%3B%0A%09line-height%3A+auto%3B%0A%09padding%3A+0px%3B%0A%09margin%3A0%3B%0A%09cursor%3Apointer%3B%0A%09position%3Aabsolute%3B%0A%09bottom%3A15px%3B%0A%09left%3A+15px%3B%0A%09width%3A308px%3B%0A%09overflow%3Avisible%3B%0A%7D%0A%23page+%23header+%23logo+a+%7B%0A%09%2F%2A+customize_header_logo+%2A%2F+color%3A+%23ffffff%3B+%2F%2A+customize_header_logo+%2A%2F%0A%09%2F%2A+customize_header_logo_text+%2A%2F+font%3A+normal+bold+32px+Arial%3B+%2F%2A+customize_header_logo_text+%2A%2F%0A%09text-decoration%3Anone%3B%0A%7D%0A%0A%23page+%23header+%23logo+p%7B+display%3Ainline%3B+line-height%3Ainherit%3B+font-size%3Ainherit%3B+padding%3Ainherit%3B+margin%3Ainherit%3B+color%3Ainherit+%7D%0A%0A%23page+%23header+ul.nav-header+%7B%0A%09list-style%3Anone%3B%0A%09margin%3A0px%3B%0A%09float%3A+right%3B+%0A%09padding%3A0px%3B%0A%09z-index%3A2%3B%0A%09overflow%3Avisible%3B%0A%7D%0A%23page+%23header+ul.nav-header+li+%7B%0A%09float%3Aleft%3B%0A%09padding%3A2px+0px%3B%0A%09margin-left%3A24px%3B%0A%09margin-bottom%3A+0px%3B%0A%09%2F%2A+customize_header_link_text+%2A%2F+color%3A%23daf095%3B+%2F%2A+customize_header_link_text+%2A%2F%0A%09font-size%3A14px%3B%0A%09letter-spacing%3A1.5px%3B%0A%09margin-top%3A0px%0A%7D%0A%23page+%23header+ul.nav-header+li+a%2C+%23page+%23header+ul.nav-header+li+a%3Ahover+%7B%0A%09text-decoration%3Anone%3B%0A%09color%3A%23daf095%0A%7D%0A%23page+%23header+ul.nav-header+li.nav-selected+%7B%0A%09font-weight%3Abold%3B%0A%7D%0A%2F%2A%0A%23page+%23header+%23header-area+%7B%0A%09position%3Arelative%3B%0A%09height%3A75px%3B%0A%7D%0A%2A%2F%0A%23page+%23header+%23header-area+%7B%0A%09position%3A+absolute%3B%0A%09bottom%3A+15px%3B%0A%09right%3A+15px%3B%0A%09width%3A+462px%3B%0A%7D%0A%0A%23page+%23homeHeader+%7B%0A%09background%3A+url%28images%2Fhome_header.jpg%29+top+left+no-repeat%3B%0A%09min-height%3A192px%3B%0A%7D%0A%0A%23page+%23homeHeader%2C+%23page+%23pageHeader+%7B%0A%09margin%3A0%3B%0A%09padding%3A0%3B%0A%09position%3Arelative%3B%0A%7D%0A%0A%23page+%23central+%7B%0A%09clear%3Aboth%3B%0A%09padding-bottom%3A30px%3B+%2F%2A+for+footer+%2A%2F%0A%7D%0A%23page.no-sidebar+%7B%0A%09background-image%3A+none+%21important%3B%0A%09background-color%3A%23f4ffd2%3B%0A%7D%0A%2F%2A+body+%26+sidebar+%2A%2F%0A%23page+%23central+%23body+%7B%0A%09float%3Aleft%3B%0A%09text-align%3Aleft%3B%0A%09width%3A542px%3B%0A%09padding%3A15px%3B%0A%09%2F%2A+customize_background+%2A%2F%0A%09background-color%3A%22%23f4ffd2%22%3B%0A%09border-color+%3A+red%3B%0A%09%2F%2A+customize_background+%2A%2F%0A%7D%0A%23page+%23central+%23sidebar+%7B%0A%09float%3Aright%3B%0A%09width%3A198px%3B%0A%09padding%3A15px+15px+30px+15px%3B%0A%09background%3A+%23daf095%3B%0A%7D%0A%23page.sidebar-left+%23central+%23sidebar+%7B%0A%09float%3Aleft%3B%0A%09width%3A+94px%0A%7D%0A%23page.sidebar-left+%23central+%23body+%7B%0A%09float%3Aright%3B%0A%09width%3A+646px%3B%0A%09padding%3A+15px%3B%0A%7D%0A%23page.no-sidebar+%23body+%7B%0A%09float%3A+none+%21important%3B%0A%09width%3A+auto+%21important%0A%7D%0A%23page+%23central+%23sidebar+p+%7B%0A%09line-height%3A24px%0A%7D%0A%23page+%23central+%23sidebar+ul.nav+%7B%0A%09list-style%3Anone%3B%0A%09margin-left%3A0px%3B%0A%09padding%3A0px%3B%0A%09padding-left%3A0%3B%0A%09font-size%3A11px%3B%0A%7D%0A%23page+%23central+%23sidebar+ul.nav+li+%7B%0A%09margin-bottom%3A10px%3B%0A%7D%0A%23page+%23central+%23sidebar+ul.nav+a+%7B%0A%09text-decoration%3Anone%3B%0A%09color%3A%2369ab2b%0A%7D%0A%23page+%23central+%23sidebar+ul.nav+a.nav-selected+%7B%0A%09font-weight%3A+bold%0A%7D%0A%23page+%23central+%23sidebar+ul.nav+a%3Ahover+%7B%0A%09text-decoration%3Aunderline%0A%7D%0A%23page+%23central+%23sidebar+ul.nav+ul+%7B%0A%09list-style%3Anone%3B%0A%09margin-left%3A5px%3B%0A%09padding%3A0px%3B%0A%09margin-top%3A10px%3B%0A%7D%0A%23page+%23central+%23sidebar+ul.nav+ul+li+%7B%0A%09padding-left%3A+5px%3B%0A%09margin%3A+0%3B%0A%09border-left%3A+1px+solid+%2369ab2b%3B%0A%7D%0A%23page+%23central+%23sidebar+ul.nav+ul+li+ul+li+%7B%0A%09list-style%3Asquare+inside%3B%0A%09padding-left%3A0%3B%0A%7D%0A%23page+%23central+%23sidebar+ul.nav+ul+li+ul+li+%7B%0A%09border%3Anone%3B%0A%7D%0A%23page+%23footer+%7B%0A%09height%3A10px%3B%0A%09line-height%3A10px%3B%0A%09background%3Aurl%28images%2Ffooter_bg.jpg%29+repeat-x%3B%0A%09clear%3Aboth%3B%0A%09color%3A%23daf095%3B%0A%09font-size%3A10px%3B%0A%09text-align%3Acenter%3B%0A%09padding%3A10px+0+10px+0%3B%0A%09position%3Aabsolute%3B%0A%09bottom%3A0%3B%0A%09width%3A100%25%0A%7D%0A%23page+%23footer+a+%7B%0A%09color%3A%23daf095%3B%0A%09text-decoration%3Anone%3B%0A%7D%0A%0Aspan.sign-in+%7Bmargin-left%3A+20px%7D%0A%23page+%23footer+span.powered-by+%7B+float%3Aright%3B+margin-right%3A20px%3B%7D%0A%0A%0A%2F%2A+MISC+STYLES+%26+SHORTCUTS+%2A%2F%0Adiv.code+%7B%0A%09border%3A+1px+solid+%23ddd%3B%0A%09background%3A+%23eee%3B%0A%09padding%3A+10px%0A%7D%0Adiv.spacer%2C+div.ccm-spacer+%7B%0A%09clear%3Aboth%3B%0A%09font-size%3A1px%3B%0A%09line-height%3A1px%0A%7D%0A.noTopSpace+%7B%0A%09margin-top%3A0px%3B%0A%09padding-top%3A0px%0A%7D%0A%0A%2F%2A+customize_miscellaneous+%2A%2F+%2F%2A+customize_miscellaneous+%2A%2F'
  264     1        INIT_FCALL                                               'replacetokenswithmap'
          2        INIT_FCALL                                               'parsecss'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $2      
          5        SEND_VAR                                                 $2
          6        SEND_VAR                                                 !0
          7        DO_FCALL                                      0  $3      
          8        ECHO                                                     $3
          9      > RETURN                                                   1

Function parsecss:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 11
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
2 jumps found. (Code = 77) Position 1 = 14, Position 2 = 43
Branch analysis from position: 14
2 jumps found. (Code = 78) Position 1 = 15, Position 2 = 43
Branch analysis from position: 15
2 jumps found. (Code = 77) Position 1 = 28, Position 2 = 41
Branch analysis from position: 28
2 jumps found. (Code = 78) Position 1 = 29, Position 2 = 41
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
Branch analysis from position: 41
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 41
Branch analysis from position: 43
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 43
filename:       /in/iPKTu
function name:  parseCSS
number of ops:  46
compiled vars:  !0 = $rawText, !1 = $matches, !2 = $selections, !3 = $realMatches, !4 = $val, !5 = $key, !6 = $elements, !7 = $v, !8 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        ASSIGN                                                   !1, <array>
    5     2        INIT_FCALL                                               'preg_match_all'
          3        SEND_VAL                                                 '%2F%5C%2F%5C%2A+customize_%28.%2B%3F%29+%5C%2A%5C%2F%28.%2B%3F%29%5C%2F%5C%2A+customize_%5C1+%5C%2A%5C%2F%2Fs'
          4        SEND_VAR                                                 !0
          5        SEND_REF                                                 !1
          6        DO_ICALL                                         $10     
          7        ASSIGN                                                   !2, $10
    6     8        BOOL_NOT                                         ~12     !2
          9      > JMPZ                                                     ~12, ->11
         10    > > RETURN                                                   <array>
    7    11    >   ASSIGN                                                   !3, <array>
    8    12        FETCH_DIM_R                                      ~14     !1, 1
         13      > FE_RESET_R                                       $15     ~14, ->43
         14    > > FE_FETCH_R                                       ~16     $15, !4, ->43
         15    >   ASSIGN                                                   !5, ~16
    9    16        ASSIGN                                                   !6, <array>
   10    17        ASSIGN_DIM                                               !3, !4
         18        OP_DATA                                                  <array>
   11    19        INIT_FCALL                                               'preg_match_all'
         20        SEND_VAL                                                 '%2F%28%5Ba-z%5C-%5D%2B%3F%29%5B%5Cs%5Ct%5D%2A%3A%28.%2B%3F%29%3B%2Fs'
         21        FETCH_DIM_R                                      ~20     !1, 2
         22        FETCH_DIM_R                                      ~21     ~20, !5
         23        SEND_VAL                                                 ~21
         24        SEND_REF                                                 !6
         25        DO_ICALL                                                 
   13    26        FETCH_DIM_R                                      ~23     !6, 1
         27      > FE_RESET_R                                       $24     ~23, ->41
         28    > > FE_FETCH_R                                       ~25     $24, !7, ->41
         29    >   ASSIGN                                                   !8, ~25
   14    30        INIT_ARRAY                                       ~29     !7
         31        INIT_FCALL                                               'trim'
         32        FETCH_DIM_R                                      ~30     !6, 2
         33        FETCH_DIM_R                                      ~31     ~30, !8
         34        SEND_VAL                                                 ~31
         35        DO_ICALL                                         $32     
         36        ADD_ARRAY_ELEMENT                                ~29     $32
         37        FETCH_DIM_W                                      $27     !3, !4
         38        ASSIGN_DIM                                               $27
         39        OP_DATA                                                  ~29
   13    40      > JMP                                                      ->28
         41    >   FE_FREE                                                  $24
    8    42      > JMP                                                      ->14
         43    >   FE_FREE                                                  $15
   17    44      > RETURN                                                   !3
   18    45*     > RETURN                                                   null

End of function parsecss

Function replacetokenswithmap:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 28
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 28
Branch analysis from position: 4
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 15
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 15
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 15
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
filename:       /in/iPKTu
function name:  replaceTokensWithMap
number of ops:  31
compiled vars:  !0 = $map, !1 = $input, !2 = $tokens, !3 = $key, !4 = $css, !5 = $token
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   22     2      > FE_RESET_R                                       $6      !0, ->28
          3    > > FE_FETCH_R                                       ~7      $6, !2, ->28
          4    >   ASSIGN                                                   !3, ~7
   23     5        ASSIGN                                                   !4, ''
   24     6      > FE_RESET_R                                       $10     !2, ->15
          7    > > FE_FETCH_R                                               $10, !5, ->15
   25     8    >   INIT_FCALL                                               'implode'
          9        SEND_VAL                                                 '%3A'
         10        SEND_VAR                                                 !5
         11        DO_ICALL                                         $11     
         12        CONCAT                                           ~12     $11, '%3B'
         13        ASSIGN_OP                                     8          !4, ~12
   24    14      > JMP                                                      ->7
         15    >   FE_FREE                                                  $10
   27    16        INIT_FCALL                                               'preg_replace'
         17        ROPE_INIT                                     5  ~15     '%2F%5C%2F%5C%2A+customize_'
         18        ROPE_ADD                                      1  ~15     ~15, !3
         19        ROPE_ADD                                      2  ~15     ~15, '+%5C%2A%5C%2F.%2B%3F%5C%2F%5C%2A+customize_'
         20        ROPE_ADD                                      3  ~15     ~15, !3
         21        ROPE_END                                      4  ~14     ~15, '+%5C%2A%5C%2F%2F'
         22        SEND_VAL                                                 ~14
         23        SEND_VAR                                                 !4
         24        SEND_VAR                                                 !1
         25        DO_ICALL                                         $18     
         26        ASSIGN                                                   !1, $18
   22    27      > JMP                                                      ->3
         28    >   FE_FREE                                                  $6
   29    29      > RETURN                                                   !1
   30    30*     > RETURN                                                   null

End of function replacetokenswithmap

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
185.24 ms | 1415 KiB | 23 Q