3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ThreePointStudio_CustomMarkupForUser_Constants { public static $availableMarkups = array( // Text Effects "bold" => array( "format" => array( array("span", array("style" => array("font-weight" => array("bold")))) ), ), "italic" => array( "format" => array( array("span", array("style" => array("font-style" => array("italic")))) ), ), "underline" => array( "format" => array( array("span", array("style" => array("text-decoration" => array("underline"))), array('mergeProperties' => true)) ), ), "overline" => array( "format" => array( array("span", array("style" => array("text-decoration" => array("overline"))), array('mergeProperties' => true)) ), ), "strike" => array( "format" => array( array("span", array("style" => array("text-decoration" => array("line-through"))), array('mergeProperties' => true)) ), ), "text_colour" => array( "format" => array( array("span", array("style" => array("color" => array("{_value}"))), array("variableFeed" => array("_value"))) ), ), "font_face" => array( "format" => array( array("span", array("style" => array("font-family" => array("{fontFamily}"))), array("variableFeed" => array("fontFamily"))) ), ), // Background and Borders "background_colour" => array( "format" => array( array("span", array("style" => array("background-color" => array("{_value}"))), array("variableFeed" => array("_value"))) ), ), "border" => array( "format" => array( array("span", array("class" => array("borderText"))) ), ), "border_colour" => array( "format" => array( array("span", array("style" => array("border-color" => array("{_value}"))), array("variableFeed" => array("_value"))) ), ), "border_style" => array( "format" => array( array("span", array("style" => array("border-style" => array("{borderStyle}"))), array("variableFeed" => array("borderStyle"))) ), ), ); public static $borderList = array( 0 => "none", 1 => "dotted", 2 => "dashed", 3 => "solid", 4 => "double", 5 => "groove", 6 => "ridge", 7 => "inset", 8 => "outset" ); // Mostly copied from http://www.ampsoft.net/webdesign-l/WindowsMacFonts.html public static $fontList = array( 0 => array("name" => "", "fullname" => "inherit"), 1 => array("name" => "Arial", "fullname" => 'Arial, Helvetica, sans-serif'), 2 => array("name" => "Arial Black", "fullname" => "'Arial Black', Gadget, sans-serif"), 3 => array("name" => "Comic Sans MS", "fullname" => "'Comic Sans MS', cursive, sans-serif"), 4 => array("name" => "Courier New", "fullname" => "'Courier New', Courier, monospace"), 5 => array("name" => "Georgia", "fullname" => 'Georgia, serif'), 6 => array("name" => "Impact", "fullname" => 'Impact, Charcoal, sans-serif'), 7 => array("name" => "Lucida Console", "fullname" => "'Lucida Console', Monaco, monospace"), 8 => array("name" => "Lucida Sans Unicode", "fullname" => "'Lucida Sans Unicode', 'Lucida Grande', sans-serif"), 9 => array("name" => "Palatino Linotype", "fullname" => "'Palatino Linotype', 'Book Antiqua', Palatino, serif"), 10 => array("name" => "Tahoma", "fullname" => 'Tahoma, Geneva, sans-serif'), 11 => array("name" => "Times New Roman", "fullname" => "'Times New Roman', Times, serif"), 12 => array("name" => "Trebuchet MS", "fullname" => "'Trebuchet MS', Helvetica, sans-serif"), 13 => array("name" => "Verdana", "fullname" => 'Verdana, Geneva, sans-serif'), ); public static $defaultOptionsArray = array( "username" => array(), "usertitle" => array() ); } $options = unserialize('a:2:{s:8:"username";a:9:{s:4:"bold";i:1;s:6:"italic";i:1;s:9:"underline";i:1;s:11:"text_colour";s:7:"#e01be0";s:9:"font_face";i:13;s:17:"background_colour";s:7:"#4683ab";s:6:"border";i:1;s:13:"border_colour";s:7:"#d91fd9";s:12:"border_style";i:1;}s:9:"usertitle";a:6:{s:4:"bold";i:1;s:6:"italic";i:1;s:9:"underline";i:1;s:6:"strike";i:1;s:8:"overline";i:1;s:9:"font_face";i:3;}}'); $sortedTags = $firstOccurrence = array(); foreach ($options[$category] as $optionName => $optionValue) { end($sortedTags); foreach (ThreePointStudio_CustomMarkupForUser_Constants::$availableMarkups[$optionName]["format"] as $tag) { $sortedTags[] = $tag; end($sortedTags); $index = key($sortedTags); $theTag = &$sortedTags[$index]; if (!in_array($theTag[0], $firstOccurrence)) { $firstOccurrence[$theTag[0]] = $index; } else { // Try to see if we can merge the properties if (isset($theTag[2]["loneTag"]) && $theTag[2]["loneTag"]) { // It wants it own tag continue; } $firstOccurrenceTag = &$sortedTags[$firstOccurrence[$theTag[0]]]; $intersection = array_keys(array_intersect_key($theTag[1], $firstOccurrenceTag[1])); if (in_array("style", $intersection)) { if ((isset($theTag[2]["mergeProperties"]) && $theTag[2]["mergeProperties"]) && (isset($firstOccurrenceTag[2]["mergeProperties"]) && $firstOccurrenceTag[2]["mergeProperties"])) { $firstOccurrenceTag[1]["style"] = array_replace_recursive($firstOccurrenceTag[1]["style"], $theTag[1]["style"]); } else { $firstOccurrenceTag[1]["style"] = array_replace($firstOccurrenceTag[1]["style"], $theTag[1]["style"]); } unset($theTag[1]["style"]); } if (in_array("class", $intersection)) { $firstOccurrenceTag[1]["class"] = array_replace($firstOccurrenceTag[1]["class"], $theTag[1]["class"]); unset($theTag[1]["class"]); } // Try to put anything that is not in the first occurrence tag into the first occurrence tag instead foreach ($theTag[1] as $attr => $attrValue) { if (!in_array($attr, array_keys($firstOccurrenceTag[1]))) { $firstOccurrenceTag[1][$attr] = $attrValue; unset($theTag[1][$attr]); } } if (empty($theTag[1])) { // No attr, drop the tag unset($sortedTags[$index]); end($sortedTags); continue; } // What is left is conflicted attributes. Leave as is in its own tag. } } } var_dump($sortedTags);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 156
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 156
Branch analysis from position: 9
2 jumps found. (Code = 77) Position 1 = 17, Position 2 = 154
Branch analysis from position: 17
2 jumps found. (Code = 78) Position 1 = 18, Position 2 = 154
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 36, Position 2 = 40
Branch analysis from position: 36
1 jumps found. (Code = 42) Position 1 = 153
Branch analysis from position: 153
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 40
2 jumps found. (Code = 46) Position 1 = 43, Position 2 = 46
Branch analysis from position: 43
2 jumps found. (Code = 43) Position 1 = 47, Position 2 = 48
Branch analysis from position: 47
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 48
2 jumps found. (Code = 43) Position 1 = 67, Position 2 = 107
Branch analysis from position: 67
2 jumps found. (Code = 46) Position 1 = 70, Position 2 = 73
Branch analysis from position: 70
2 jumps found. (Code = 46) Position 1 = 74, Position 2 = 81
Branch analysis from position: 74
2 jumps found. (Code = 46) Position 1 = 77, Position 2 = 80
Branch analysis from position: 77
2 jumps found. (Code = 43) Position 1 = 82, Position 2 = 94
Branch analysis from position: 82
1 jumps found. (Code = 42) Position 1 = 105
Branch analysis from position: 105
2 jumps found. (Code = 43) Position 1 = 112, Position 2 = 125
Branch analysis from position: 112
2 jumps found. (Code = 77) Position 1 = 127, Position 2 = 145
Branch analysis from position: 127
2 jumps found. (Code = 78) Position 1 = 128, Position 2 = 145
Branch analysis from position: 128
2 jumps found. (Code = 43) Position 1 = 139, Position 2 = 144
Branch analysis from position: 139
1 jumps found. (Code = 42) Position 1 = 127
Branch analysis from position: 127
Branch analysis from position: 144
Branch analysis from position: 145
2 jumps found. (Code = 43) Position 1 = 148, Position 2 = 153
Branch analysis from position: 148
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 153
Branch analysis from position: 145
Branch analysis from position: 125
Branch analysis from position: 94
2 jumps found. (Code = 43) Position 1 = 112, Position 2 = 125
Branch analysis from position: 112
Branch analysis from position: 125
Branch analysis from position: 80
Branch analysis from position: 81
Branch analysis from position: 73
Branch analysis from position: 107
Branch analysis from position: 46
Branch analysis from position: 154
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 154
Branch analysis from position: 156
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 156
filename:       /in/2v0li
function name:  (null)
number of ops:  161
compiled vars:  !0 = $options, !1 = $sortedTags, !2 = $firstOccurrence, !3 = $category, !4 = $optionValue, !5 = $optionName, !6 = $tag, !7 = $index, !8 = $theTag, !9 = $firstOccurrenceTag, !10 = $intersection, !11 = $attrValue, !12 = $attr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  101     0  E >   INIT_FCALL                                               'unserialize'
          1        SEND_VAL                                                 'a%3A2%3A%7Bs%3A8%3A%22username%22%3Ba%3A9%3A%7Bs%3A4%3A%22bold%22%3Bi%3A1%3Bs%3A6%3A%22italic%22%3Bi%3A1%3Bs%3A9%3A%22underline%22%3Bi%3A1%3Bs%3A11%3A%22text_colour%22%3Bs%3A7%3A%22%23e01be0%22%3Bs%3A9%3A%22font_face%22%3Bi%3A13%3Bs%3A17%3A%22background_colour%22%3Bs%3A7%3A%22%234683ab%22%3Bs%3A6%3A%22border%22%3Bi%3A1%3Bs%3A13%3A%22border_colour%22%3Bs%3A7%3A%22%23d91fd9%22%3Bs%3A12%3A%22border_style%22%3Bi%3A1%3B%7Ds%3A9%3A%22usertitle%22%3Ba%3A6%3A%7Bs%3A4%3A%22bold%22%3Bi%3A1%3Bs%3A6%3A%22italic%22%3Bi%3A1%3Bs%3A9%3A%22underline%22%3Bi%3A1%3Bs%3A6%3A%22strike%22%3Bi%3A1%3Bs%3A8%3A%22overline%22%3Bi%3A1%3Bs%3A9%3A%22font_face%22%3Bi%3A3%3B%7D%7D'
          2        DO_ICALL                                         $13     
          3        ASSIGN                                                   !0, $13
  103     4        ASSIGN                                           ~15     !2, <array>
          5        ASSIGN                                                   !1, ~15
  105     6        FETCH_DIM_R                                      ~17     !0, !3
          7      > FE_RESET_R                                       $18     ~17, ->156
          8    > > FE_FETCH_R                                       ~19     $18, !4, ->156
          9    >   ASSIGN                                                   !5, ~19
  106    10        INIT_FCALL                                               'end'
         11        SEND_REF                                                 !1
         12        DO_ICALL                                                 
  107    13        FETCH_STATIC_PROP_R          unknown             ~22     'availableMarkups'
         14        FETCH_DIM_R                                      ~23     ~22, !5
         15        FETCH_DIM_R                                      ~24     ~23, 'format'
         16      > FE_RESET_R                                       $25     ~24, ->154
         17    > > FE_FETCH_R                                               $25, !6, ->154
  108    18    >   ASSIGN_DIM                                               !1
         19        OP_DATA                                                  !6
  109    20        INIT_FCALL                                               'end'
         21        SEND_REF                                                 !1
         22        DO_ICALL                                                 
  110    23        INIT_FCALL                                               'key'
         24        SEND_VAR                                                 !1
         25        DO_ICALL                                         $28     
         26        ASSIGN                                                   !7, $28
  111    27        FETCH_DIM_W                                      $30     !1, !7
         28        ASSIGN_REF                                               !8, $30
  112    29        INIT_FCALL                                               'in_array'
         30        FETCH_DIM_R                                      ~32     !8, 0
         31        SEND_VAL                                                 ~32
         32        SEND_VAR                                                 !2
         33        DO_ICALL                                         $33     
         34        BOOL_NOT                                         ~34     $33
         35      > JMPZ                                                     ~34, ->40
  113    36    >   FETCH_DIM_R                                      ~35     !8, 0
         37        ASSIGN_DIM                                               !2, ~35
         38        OP_DATA                                                  !7
         39      > JMP                                                      ->153
  116    40    >   FETCH_DIM_IS                                     ~37     !8, 2
         41        ISSET_ISEMPTY_DIM_OBJ                         0  ~38     ~37, 'loneTag'
         42      > JMPZ_EX                                          ~38     ~38, ->46
         43    >   FETCH_DIM_R                                      ~39     !8, 2
         44        FETCH_DIM_R                                      ~40     ~39, 'loneTag'
         45        BOOL                                             ~38     ~40
         46    > > JMPZ                                                     ~38, ->48
  117    47    > > JMP                                                      ->17
  119    48    >   FETCH_DIM_R                                      ~41     !8, 0
         49        FETCH_DIM_R                                      ~42     !2, ~41
         50        FETCH_DIM_W                                      $43     !1, ~42
         51        ASSIGN_REF                                               !9, $43
  120    52        INIT_FCALL                                               'array_keys'
         53        INIT_FCALL                                               'array_intersect_key'
         54        FETCH_DIM_R                                      ~45     !8, 1
         55        SEND_VAL                                                 ~45
         56        FETCH_DIM_R                                      ~46     !9, 1
         57        SEND_VAL                                                 ~46
         58        DO_ICALL                                         $47     
         59        SEND_VAR                                                 $47
         60        DO_ICALL                                         $48     
         61        ASSIGN                                                   !10, $48
  121    62        INIT_FCALL                                               'in_array'
         63        SEND_VAL                                                 'style'
         64        SEND_VAR                                                 !10
         65        DO_ICALL                                         $50     
         66      > JMPZ                                                     $50, ->107
  122    67    >   FETCH_DIM_IS                                     ~51     !8, 2
         68        ISSET_ISEMPTY_DIM_OBJ                         0  ~52     ~51, 'mergeProperties'
         69      > JMPZ_EX                                          ~52     ~52, ->73
         70    >   FETCH_DIM_R                                      ~53     !8, 2
         71        FETCH_DIM_R                                      ~54     ~53, 'mergeProperties'
         72        BOOL                                             ~52     ~54
         73    > > JMPZ_EX                                          ~52     ~52, ->81
  123    74    >   FETCH_DIM_IS                                     ~55     !9, 2
         75        ISSET_ISEMPTY_DIM_OBJ                         0  ~56     ~55, 'mergeProperties'
         76      > JMPZ_EX                                          ~56     ~56, ->80
         77    >   FETCH_DIM_R                                      ~57     !9, 2
         78        FETCH_DIM_R                                      ~58     ~57, 'mergeProperties'
         79        BOOL                                             ~56     ~58
         80    >   BOOL                                             ~52     ~56
         81    > > JMPZ                                                     ~52, ->94
  124    82    >   INIT_FCALL                                               'array_replace_recursive'
         83        FETCH_DIM_R                                      ~61     !9, 1
         84        FETCH_DIM_R                                      ~62     ~61, 'style'
         85        SEND_VAL                                                 ~62
         86        FETCH_DIM_R                                      ~63     !8, 1
         87        FETCH_DIM_R                                      ~64     ~63, 'style'
         88        SEND_VAL                                                 ~64
         89        DO_ICALL                                         $65     
         90        FETCH_DIM_W                                      $59     !9, 1
         91        ASSIGN_DIM                                               $59, 'style'
         92        OP_DATA                                                  $65
         93      > JMP                                                      ->105
  126    94    >   INIT_FCALL                                               'array_replace'
         95        FETCH_DIM_R                                      ~68     !9, 1
         96        FETCH_DIM_R                                      ~69     ~68, 'style'
         97        SEND_VAL                                                 ~69
         98        FETCH_DIM_R                                      ~70     !8, 1
         99        FETCH_DIM_R                                      ~71     ~70, 'style'
        100        SEND_VAL                                                 ~71
        101        DO_ICALL                                         $72     
        102        FETCH_DIM_W                                      $66     !9, 1
        103        ASSIGN_DIM                                               $66, 'style'
        104        OP_DATA                                                  $72
  128   105    >   FETCH_DIM_UNSET                                  $73     !8, 1
        106        UNSET_DIM                                                $73, 'style'
  130   107    >   INIT_FCALL                                               'in_array'
        108        SEND_VAL                                                 'class'
        109        SEND_VAR                                                 !10
        110        DO_ICALL                                         $74     
        111      > JMPZ                                                     $74, ->125
  131   112    >   INIT_FCALL                                               'array_replace'
        113        FETCH_DIM_R                                      ~77     !9, 1
        114        FETCH_DIM_R                                      ~78     ~77, 'class'
        115        SEND_VAL                                                 ~78
        116        FETCH_DIM_R                                      ~79     !8, 1
        117        FETCH_DIM_R                                      ~80     ~79, 'class'
        118        SEND_VAL                                                 ~80
        119        DO_ICALL                                         $81     
        120        FETCH_DIM_W                                      $75     !9, 1
        121        ASSIGN_DIM                                               $75, 'class'
        122        OP_DATA                                                  $81
  132   123        FETCH_DIM_UNSET                                  $82     !8, 1
        124        UNSET_DIM                                                $82, 'class'
  136   125    >   FETCH_DIM_R                                      ~83     !8, 1
        126      > FE_RESET_R                                       $84     ~83, ->145
        127    > > FE_FETCH_R                                       ~85     $84, !11, ->145
        128    >   ASSIGN                                                   !12, ~85
  137   129        INIT_FCALL                                               'in_array'
        130        SEND_VAR                                                 !12
        131        INIT_FCALL                                               'array_keys'
        132        FETCH_DIM_R                                      ~87     !9, 1
        133        SEND_VAL                                                 ~87
        134        DO_ICALL                                         $88     
        135        SEND_VAR                                                 $88
        136        DO_ICALL                                         $89     
        137        BOOL_NOT                                         ~90     $89
        138      > JMPZ                                                     ~90, ->144
  138   139    >   FETCH_DIM_W                                      $91     !9, 1
        140        ASSIGN_DIM                                               $91, !12
        141        OP_DATA                                                  !11
  139   142        FETCH_DIM_UNSET                                  $93     !8, 1
        143        UNSET_DIM                                                $93, !12
  136   144    > > JMP                                                      ->127
        145    >   FE_FREE                                                  $84
  143   146        ISSET_ISEMPTY_DIM_OBJ                         1          !8, 1
        147      > JMPZ                                                     ~94, ->153
  145   148    >   UNSET_DIM                                                !1, !7
  146   149        INIT_FCALL                                               'end'
        150        SEND_REF                                                 !1
        151        DO_ICALL                                                 
  147   152      > JMP                                                      ->17
  107   153    > > JMP                                                      ->17
        154    >   FE_FREE                                                  $25
  105   155      > JMP                                                      ->8
        156    >   FE_FREE                                                  $18
  154   157        INIT_FCALL                                               'var_dump'
        158        SEND_VAR                                                 !1
        159        DO_ICALL                                                 
        160      > RETURN                                                   1

Class ThreePointStudio_CustomMarkupForUser_Constants: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.99 ms | 1412 KiB | 31 Q