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);

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.3.60.0090.01318.39
8.3.50.0070.01522.05
8.3.40.0030.01218.86
8.3.30.0080.01119.18
8.3.20.0050.00320.16
8.3.10.0040.00422.21
8.3.00.0040.00422.58
8.2.180.0120.00316.34
8.2.170.0110.01122.96
8.2.160.0120.00320.94
8.2.150.0040.00424.18
8.2.140.0030.00624.66
8.2.130.0080.00026.16
8.2.120.0030.00619.48
8.2.110.0120.00922.08
8.2.100.0100.00319.63
8.2.90.0040.00419.27
8.2.80.0040.00418.16
8.2.70.0080.00017.63
8.2.60.0040.00418.04
8.2.50.0090.00018.07
8.2.40.0030.00618.22
8.2.30.0000.00818.08
8.2.20.0050.00317.80
8.2.10.0030.00517.71
8.2.00.0000.00817.92
8.1.280.0090.00625.92
8.1.270.0090.00022.23
8.1.260.0050.00326.35
8.1.250.0080.00028.09
8.1.240.0060.00323.92
8.1.230.0080.00319.29
8.1.220.0000.00817.89
8.1.210.0000.00818.77
8.1.200.0030.00617.60
8.1.190.0040.00417.55
8.1.180.0000.00918.10
8.1.170.0030.00618.59
8.1.160.0000.00822.07
8.1.150.0040.00418.71
8.1.140.0000.00817.46
8.1.130.0040.00417.80
8.1.120.0000.00817.60
8.1.110.0030.00517.59
8.1.100.0000.00817.58
8.1.90.0040.00417.56
8.1.80.0000.00817.52
8.1.70.0000.00817.48
8.1.60.0030.00617.64
8.1.50.0080.00017.66
8.1.40.0030.00617.57
8.1.30.0040.00417.63
8.1.20.0030.00517.64
8.1.10.0040.00417.55
8.1.00.0040.00417.52
8.0.300.0060.00318.77
8.0.290.0080.00017.16
8.0.280.0000.00718.50
8.0.270.0040.00417.22
8.0.260.0000.00716.89
8.0.250.0030.00317.14
8.0.240.0100.00017.02
8.0.230.0080.00017.11
8.0.220.0030.00517.00
8.0.210.0040.00417.02
8.0.200.0020.00517.14
8.0.190.0000.00717.04
8.0.180.0040.00417.03
8.0.170.0030.00617.10
8.0.160.0040.00417.00
8.0.150.0090.00317.07
8.0.140.0000.00716.90
8.0.130.0030.00313.54
8.0.120.0050.00317.03
8.0.110.0050.00316.93
8.0.100.0070.00017.02
8.0.90.0040.00416.90
8.0.80.0030.01317.05
8.0.70.0000.00717.06
8.0.60.0030.00516.95
8.0.50.0050.00317.16
8.0.30.0170.00517.02
8.0.20.0180.00517.40
8.0.10.0080.00017.15
8.0.00.0140.00616.79
7.4.330.0050.00015.05
7.4.320.0000.00616.69
7.4.300.0030.00516.57
7.4.290.0040.00416.66
7.4.280.0050.00216.59
7.4.270.0000.00816.60
7.4.260.0030.00916.67
7.4.250.0030.00516.70
7.4.240.0020.00516.72
7.4.230.0030.00316.70
7.4.220.0140.01016.67
7.4.210.0040.01316.72
7.4.200.0040.00416.67
7.4.190.0040.00416.86
7.4.160.0110.00716.68
7.4.150.0150.00417.40
7.4.140.0100.01117.86
7.4.130.0120.00816.75
7.4.120.0070.01416.71
7.4.110.0130.00416.69
7.4.100.0060.01516.87
7.4.90.0170.00316.67
7.4.80.0100.01319.39
7.4.70.0080.01216.57
7.4.60.0120.00616.65
7.4.50.0040.00416.59
7.4.40.0070.01022.77
7.4.30.0160.02816.72
7.4.00.0060.00915.04
7.3.330.0000.00813.38
7.3.320.0050.00013.28
7.3.310.0070.00016.38
7.3.300.0000.00716.46
7.3.290.0000.02116.52
7.3.280.0140.00816.54
7.3.270.0100.00717.40
7.3.260.0070.01116.78
7.3.250.0110.00816.60
7.3.240.0150.00316.50
7.3.230.0070.01116.54
7.3.210.0120.00616.65
7.3.200.0130.00819.39
7.3.190.0150.00416.71
7.3.180.0030.01316.72
7.3.170.0060.01216.68
7.3.160.0070.01016.64
7.3.120.0110.00715.22
7.3.10.0100.00416.51
7.3.00.0090.00516.60
7.2.330.0100.01016.66
7.2.320.0180.00916.66
7.2.310.0030.01316.46
7.2.300.0030.01716.86
7.2.290.0090.01516.72
7.2.130.0080.00816.73
7.2.120.0100.00616.64
7.2.110.0070.00916.65
7.2.100.0050.01116.64
7.2.90.0070.00716.86
7.2.80.0130.00416.75
7.2.70.0080.01016.81
7.2.60.0030.01216.74
7.2.50.0060.00917.01
7.2.40.0090.00616.91
7.2.30.0080.00817.02
7.2.20.0050.01216.89
7.2.10.0060.00816.75
7.2.00.0070.00916.91
7.1.250.0060.00815.72
7.1.70.0030.00517.19
7.1.60.0160.00619.82
7.1.50.0040.01917.03
7.1.00.0070.07722.54
7.0.200.0060.00316.68
7.0.140.0030.07322.07
7.0.60.0100.05019.88
7.0.50.0130.06717.95
7.0.40.0200.07720.21
7.0.30.0370.05720.09
7.0.20.0270.08020.10
7.0.10.0270.07720.10
7.0.00.0100.08320.11
5.6.280.0100.06721.14
5.6.210.0070.08320.78
5.6.200.0130.07718.17
5.6.190.0170.04720.63
5.6.180.3300.04020.67
5.6.170.0330.07720.48
5.6.160.0030.05720.71
5.6.150.0000.05718.22
5.6.140.0070.04018.32
5.6.130.0070.08018.28
5.6.120.0170.08021.09
5.6.110.0130.08321.15
5.6.100.0130.07721.18
5.6.90.0030.05321.04
5.6.80.0100.06720.47
5.6.70.3300.03720.43
5.5.350.0000.03720.51
5.5.340.0070.04018.00
5.5.330.0030.04320.21
5.5.320.0270.05020.32
5.5.310.0370.07720.32
5.5.300.0100.06317.98
5.5.290.0070.08317.99
5.5.280.0070.06320.91
5.5.270.0070.08720.93
5.5.260.0000.06720.94
5.5.250.0000.08720.72
5.5.240.0070.08320.35
5.4.450.1800.04719.43
5.4.440.1770.04319.39
5.4.430.1800.03019.38
5.4.420.1900.03719.31
5.4.410.1130.05719.33
5.4.400.0070.07719.09
5.4.390.0000.05319.31
5.4.380.1170.04019.07
5.4.370.1830.04719.15
5.4.360.2000.04319.13
5.4.350.1570.04019.17
5.4.340.1600.04019.24
5.4.320.1530.04018.89
5.4.310.1500.03718.88
5.4.300.1570.03319.30
5.4.290.1600.04718.87
5.4.280.1630.04319.08
5.4.270.1570.04319.00
5.4.260.0870.05019.09
5.4.250.0000.04018.96
5.4.240.0070.04319.05
5.4.230.1400.03719.13
5.4.220.1970.04319.21
5.4.210.1430.04718.99
5.4.200.1170.03718.87
5.4.190.1500.04019.07
5.4.180.1500.03719.23
5.4.170.1470.04019.07
5.4.160.1570.03719.18
5.4.150.1530.04319.24
5.4.140.1470.03716.46
5.4.130.1470.03716.33
5.4.120.1830.04716.42
5.4.110.0900.03716.46
5.4.100.0100.03016.54
5.4.90.0000.03716.58
5.4.80.0870.03016.59
5.4.70.1430.03016.62
5.4.60.1200.02716.43
5.4.50.0730.03716.56
5.4.40.0070.03016.27
5.4.30.0030.03316.44
5.4.20.0600.04016.50
5.4.10.1070.04016.55
5.4.00.0330.04316.20
5.3.290.0200.04014.80
5.3.280.0130.04014.68
5.3.270.0200.04314.68
5.3.260.0370.02714.69
5.3.250.0170.03714.57
5.3.240.0230.04714.73
5.3.230.0270.03714.89
5.3.220.0200.06014.64
5.3.210.0270.04714.64
5.3.200.0230.07314.70
5.3.190.0230.04014.68
5.3.180.0270.06714.77
5.3.170.0270.03714.71
5.3.160.0230.05014.55
5.3.150.0230.06314.60
5.3.140.0230.06714.53
5.3.130.0270.06714.63
5.3.120.0370.08014.63
5.3.110.0170.06714.67
5.3.100.0200.07314.09
5.3.90.0330.07314.17
5.3.80.0400.06714.06
5.3.70.0230.06314.20
5.3.60.0300.06314.04
5.3.50.0300.06314.02
5.3.40.0200.06014.09
5.3.30.0130.03714.12
5.3.20.0230.07013.67
5.3.10.0300.07013.77
5.3.00.0230.03313.75
5.2.170.0130.05711.29
5.2.160.0300.05011.44
5.2.150.0130.03011.34
5.2.140.0130.03311.30
5.2.130.0170.04711.09
5.2.120.0230.05311.26
5.2.110.0070.04011.23
5.2.100.0170.04011.10
5.2.90.0130.03011.18
5.2.80.0130.02711.17
5.2.70.0130.02711.25
5.2.60.0200.05311.23
5.2.50.0130.03311.00
5.2.40.0130.02311.07
5.2.30.0130.02711.01
5.2.20.0200.03311.11
5.2.10.0200.02711.09
5.2.00.0200.04310.69
5.1.60.0270.03710.08
5.1.50.0130.0279.96
5.1.40.0130.0239.95
5.1.30.0130.03010.64
5.1.20.0100.06010.35
5.1.10.0070.04310.02
5.1.00.0200.05010.27
5.0.50.0100.0208.72
5.0.40.0070.0408.39
5.0.30.0030.0378.19
5.0.20.0100.0178.37
5.0.10.0030.0478.48
5.0.00.0070.0638.14
4.4.90.0130.0277.84
4.4.80.0070.0277.84
4.4.70.0070.0377.84
4.4.60.0130.0307.84
4.4.50.0070.0307.84
4.4.40.0030.0337.84
4.4.30.0070.0237.84
4.4.20.0030.0207.84
4.4.10.0030.0207.84
4.4.00.0070.0477.84
4.3.110.0070.0237.84
4.3.100.0070.0177.84
4.3.90.0030.0177.84
4.3.80.0030.0477.84
4.3.70.0200.0207.84
4.3.60.0000.0307.84
4.3.50.0030.0237.84
4.3.40.0030.0507.84
4.3.30.0000.0207.84
4.3.20.0000.0377.84
4.3.10.0000.0407.84
4.3.00.0070.0137.84

preferences:
43.79 ms | 401 KiB | 5 Q