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("p", 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["username"] 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/icQU7
function name:  (null)
number of ops:  161
compiled vars:  !0 = $options, !1 = $sortedTags, !2 = $firstOccurrence, !3 = $optionValue, !4 = $optionName, !5 = $tag, !6 = $index, !7 = $theTag, !8 = $firstOccurrenceTag, !9 = $intersection, !10 = $attrValue, !11 = $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                                         $12     
          3        ASSIGN                                                   !0, $12
  103     4        ASSIGN                                           ~14     !2, <array>
          5        ASSIGN                                                   !1, ~14
  105     6        FETCH_DIM_R                                      ~16     !0, 'username'
          7      > FE_RESET_R                                       $17     ~16, ->156
          8    > > FE_FETCH_R                                       ~18     $17, !3, ->156
          9    >   ASSIGN                                                   !4, ~18
  106    10        INIT_FCALL                                               'end'
         11        SEND_REF                                                 !1
         12        DO_ICALL                                                 
  107    13        FETCH_STATIC_PROP_R          unknown             ~21     'availableMarkups'
         14        FETCH_DIM_R                                      ~22     ~21, !4
         15        FETCH_DIM_R                                      ~23     ~22, 'format'
         16      > FE_RESET_R                                       $24     ~23, ->154
         17    > > FE_FETCH_R                                               $24, !5, ->154
  108    18    >   ASSIGN_DIM                                               !1
         19        OP_DATA                                                  !5
  109    20        INIT_FCALL                                               'end'
         21        SEND_REF                                                 !1
         22        DO_ICALL                                                 
  110    23        INIT_FCALL                                               'key'
         24        SEND_VAR                                                 !1
         25        DO_ICALL                                         $27     
         26        ASSIGN                                                   !6, $27
  111    27        FETCH_DIM_W                                      $29     !1, !6
         28        ASSIGN_REF                                               !7, $29
  112    29        INIT_FCALL                                               'in_array'
         30        FETCH_DIM_R                                      ~31     !7, 0
         31        SEND_VAL                                                 ~31
         32        SEND_VAR                                                 !2
         33        DO_ICALL                                         $32     
         34        BOOL_NOT                                         ~33     $32
         35      > JMPZ                                                     ~33, ->40
  113    36    >   FETCH_DIM_R                                      ~34     !7, 0
         37        ASSIGN_DIM                                               !2, ~34
         38        OP_DATA                                                  !6
         39      > JMP                                                      ->153
  116    40    >   FETCH_DIM_IS                                     ~36     !7, 2
         41        ISSET_ISEMPTY_DIM_OBJ                         0  ~37     ~36, 'loneTag'
         42      > JMPZ_EX                                          ~37     ~37, ->46
         43    >   FETCH_DIM_R                                      ~38     !7, 2
         44        FETCH_DIM_R                                      ~39     ~38, 'loneTag'
         45        BOOL                                             ~37     ~39
         46    > > JMPZ                                                     ~37, ->48
  117    47    > > JMP                                                      ->17
  119    48    >   FETCH_DIM_R                                      ~40     !7, 0
         49        FETCH_DIM_R                                      ~41     !2, ~40
         50        FETCH_DIM_W                                      $42     !1, ~41
         51        ASSIGN_REF                                               !8, $42
  120    52        INIT_FCALL                                               'array_keys'
         53        INIT_FCALL                                               'array_intersect_key'
         54        FETCH_DIM_R                                      ~44     !7, 1
         55        SEND_VAL                                                 ~44
         56        FETCH_DIM_R                                      ~45     !8, 1
         57        SEND_VAL                                                 ~45
         58        DO_ICALL                                         $46     
         59        SEND_VAR                                                 $46
         60        DO_ICALL                                         $47     
         61        ASSIGN                                                   !9, $47
  121    62        INIT_FCALL                                               'in_array'
         63        SEND_VAL                                                 'style'
         64        SEND_VAR                                                 !9
         65        DO_ICALL                                         $49     
         66      > JMPZ                                                     $49, ->107
  122    67    >   FETCH_DIM_IS                                     ~50     !7, 2
         68        ISSET_ISEMPTY_DIM_OBJ                         0  ~51     ~50, 'mergeProperties'
         69      > JMPZ_EX                                          ~51     ~51, ->73
         70    >   FETCH_DIM_R                                      ~52     !7, 2
         71        FETCH_DIM_R                                      ~53     ~52, 'mergeProperties'
         72        BOOL                                             ~51     ~53
         73    > > JMPZ_EX                                          ~51     ~51, ->81
  123    74    >   FETCH_DIM_IS                                     ~54     !8, 2
         75        ISSET_ISEMPTY_DIM_OBJ                         0  ~55     ~54, 'mergeProperties'
         76      > JMPZ_EX                                          ~55     ~55, ->80
         77    >   FETCH_DIM_R                                      ~56     !8, 2
         78        FETCH_DIM_R                                      ~57     ~56, 'mergeProperties'
         79        BOOL                                             ~55     ~57
         80    >   BOOL                                             ~51     ~55
         81    > > JMPZ                                                     ~51, ->94
  124    82    >   INIT_FCALL                                               'array_replace_recursive'
         83        FETCH_DIM_R                                      ~60     !8, 1
         84        FETCH_DIM_R                                      ~61     ~60, 'style'
         85        SEND_VAL                                                 ~61
         86        FETCH_DIM_R                                      ~62     !7, 1
         87        FETCH_DIM_R                                      ~63     ~62, 'style'
         88        SEND_VAL                                                 ~63
         89        DO_ICALL                                         $64     
         90        FETCH_DIM_W                                      $58     !8, 1
         91        ASSIGN_DIM                                               $58, 'style'
         92        OP_DATA                                                  $64
         93      > JMP                                                      ->105
  126    94    >   INIT_FCALL                                               'array_replace'
         95        FETCH_DIM_R                                      ~67     !8, 1
         96        FETCH_DIM_R                                      ~68     ~67, 'style'
         97        SEND_VAL                                                 ~68
         98        FETCH_DIM_R                                      ~69     !7, 1
         99        FETCH_DIM_R                                      ~70     ~69, 'style'
        100        SEND_VAL                                                 ~70
        101        DO_ICALL                                         $71     
        102        FETCH_DIM_W                                      $65     !8, 1
        103        ASSIGN_DIM                                               $65, 'style'
        104        OP_DATA                                                  $71
  128   105    >   FETCH_DIM_UNSET                                  $72     !7, 1
        106        UNSET_DIM                                                $72, 'style'
  130   107    >   INIT_FCALL                                               'in_array'
        108        SEND_VAL                                                 'class'
        109        SEND_VAR                                                 !9
        110        DO_ICALL                                         $73     
        111      > JMPZ                                                     $73, ->125
  131   112    >   INIT_FCALL                                               'array_replace'
        113        FETCH_DIM_R                                      ~76     !8, 1
        114        FETCH_DIM_R                                      ~77     ~76, 'class'
        115        SEND_VAL                                                 ~77
        116        FETCH_DIM_R                                      ~78     !7, 1
        117        FETCH_DIM_R                                      ~79     ~78, 'class'
        118        SEND_VAL                                                 ~79
        119        DO_ICALL                                         $80     
        120        FETCH_DIM_W                                      $74     !8, 1
        121        ASSIGN_DIM                                               $74, 'class'
        122        OP_DATA                                                  $80
  132   123        FETCH_DIM_UNSET                                  $81     !7, 1
        124        UNSET_DIM                                                $81, 'class'
  136   125    >   FETCH_DIM_R                                      ~82     !7, 1
        126      > FE_RESET_R                                       $83     ~82, ->145
        127    > > FE_FETCH_R                                       ~84     $83, !10, ->145
        128    >   ASSIGN                                                   !11, ~84
  137   129        INIT_FCALL                                               'in_array'
        130        SEND_VAR                                                 !11
        131        INIT_FCALL                                               'array_keys'
        132        FETCH_DIM_R                                      ~86     !8, 1
        133        SEND_VAL                                                 ~86
        134        DO_ICALL                                         $87     
        135        SEND_VAR                                                 $87
        136        DO_ICALL                                         $88     
        137        BOOL_NOT                                         ~89     $88
        138      > JMPZ                                                     ~89, ->144
  138   139    >   FETCH_DIM_W                                      $90     !8, 1
        140        ASSIGN_DIM                                               $90, !11
        141        OP_DATA                                                  !10
  139   142        FETCH_DIM_UNSET                                  $92     !7, 1
        143        UNSET_DIM                                                $92, !11
  136   144    > > JMP                                                      ->127
        145    >   FE_FREE                                                  $83
  143   146        ISSET_ISEMPTY_DIM_OBJ                         1          !7, 1
        147      > JMPZ                                                     ~93, ->153
  145   148    >   UNSET_DIM                                                !1, !6
  146   149        INIT_FCALL                                               'end'
        150        SEND_REF                                                 !1
        151        DO_ICALL                                                 
  147   152      > JMP                                                      ->17
  107   153    > > JMP                                                      ->17
        154    >   FE_FREE                                                  $24
  105   155      > JMP                                                      ->8
        156    >   FE_FREE                                                  $17
  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:
155.28 ms | 1417 KiB | 31 Q