3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ColorCLI { static $foreground_colors = array( 'bold' => '1', 'dim' => '2', 'black' => '0;30', 'dark_gray' => '1;30', 'blue' => '0;34', 'light_blue' => '1;34', 'green' => '0;32', 'light_green' => '1;32', 'cyan' => '0;36', 'light_cyan' => '1;36', 'red' => '0;31', 'light_red' => '1;31', 'purple' => '0;35', 'light_purple' => '1;35', 'brown' => '0;33', 'yellow' => '1;33', 'light_gray' => '0;37', 'white' => '1;37', 'normal' => '0;39', ); static $background_colors = array( 'black' => '40', 'red' => '41', 'green' => '42', 'yellow' => '43', 'blue' => '44', 'magenta' => '45', 'cyan' => '46', 'light_gray' => '47', ); static $options = array( 'underline' => '4', 'blink' => '5', 'reverse' => '7', 'hidden' => '8', ); public static function __callStatic( $foreground_color, $args ) { $string = $args[0]; $colored_string = ""; // Check if given foreground color found if( isset(self::$foreground_colors[$foreground_color]) ) { $colored_string .= "\033[" . self::$foreground_colors[$foreground_color] . "m"; }else{ die( $foreground_color . ' not a valid color'); } array_shift($args); foreach( $args as $option ){ // Check if given background color found if(isset(self::$background_colors[$option])) { $colored_string .= "\033[" . self::$background_colors[$option] . "m"; }elseif(isset(self::$options[$option])) { $colored_string .= "\033[" . self::$options[$option] . "m"; } } // Add string and end coloring $colored_string .= $string . "\033[0m"; return $colored_string; } public static function bell($count = 1) { echo str_repeat("\007", $count); } } echo ColorCLI.red("text");

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.0110.00418.37
8.3.50.0100.00922.05
8.3.40.0160.00618.87
8.3.30.0150.00619.14
8.3.20.0090.00020.14
8.3.10.0080.00020.36
8.3.00.0080.00019.38
8.2.180.0150.00616.63
8.2.170.0140.00722.96
8.2.160.0100.00320.26
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0040.00422.22
8.2.110.0000.00820.30
8.2.100.0040.00718.16
8.2.90.0000.00819.15
8.2.80.0050.00317.97
8.2.70.0000.00817.50
8.2.60.0040.00417.93
8.2.50.0090.00018.07
8.2.40.0030.00518.28
8.2.30.0080.00019.27
8.2.20.0040.00417.75
8.2.10.0030.00518.08
8.2.00.0050.00317.73
8.1.280.0140.00725.92
8.1.270.0050.00323.68
8.1.260.0000.00926.35
8.1.250.0000.00728.09
8.1.240.0090.00022.15
8.1.230.0060.00619.09
8.1.220.0030.00617.78
8.1.210.0030.00618.77
8.1.200.0030.00617.35
8.1.190.0050.00317.35
8.1.180.0000.00718.10
8.1.170.0130.00018.17
8.1.160.0040.00422.04
8.1.150.0000.00818.91
8.1.140.0050.00217.41
8.1.130.0030.00317.28
8.1.120.0040.00417.31
8.1.110.0000.00717.39
8.1.100.0040.00417.39
8.1.90.0070.00017.36
8.1.80.0040.00317.32
8.1.70.0030.00317.38
8.1.60.0090.00017.46
8.1.50.0050.00317.38
8.1.40.0030.00617.36
8.1.30.0000.00917.54
8.1.20.0000.00817.54
8.1.10.0070.00017.54
8.1.00.0040.00417.44
8.0.300.0030.00518.77
8.0.290.0070.00016.75
8.0.280.0000.00718.35
8.0.270.0070.00017.29
8.0.260.0060.00016.85
8.0.250.0030.00317.02
8.0.240.0070.00017.04
8.0.230.0030.00317.06
8.0.220.0000.00716.87
8.0.210.0030.00317.00
8.0.200.0030.00617.04
8.0.190.0000.00816.95
8.0.180.0070.00017.00
8.0.170.0030.00517.02
8.0.160.0030.00516.84
8.0.150.0030.00316.77
8.0.140.0100.00016.96
8.0.130.0000.00513.39
8.0.120.0030.00516.94
8.0.110.0050.00316.88
8.0.100.0040.00417.02
8.0.90.0040.00416.81
8.0.80.0110.00416.96
8.0.70.0040.00416.85
8.0.60.0000.00816.85
8.0.50.0000.00716.84
8.0.30.0110.00917.18
8.0.20.0190.00517.40
8.0.10.0000.00716.84
8.0.00.0050.01216.71
7.4.330.0000.00515.09
7.4.320.0000.00716.60
7.4.300.0030.00316.56
7.4.290.0030.00316.42
7.4.280.0030.00516.51
7.4.270.0000.00716.59
7.4.260.0050.00216.60
7.4.250.0000.00716.36
7.4.240.0040.00416.55
7.4.230.0060.00316.45
7.4.220.0060.01616.56
7.4.210.0070.00716.53
7.4.200.0000.00716.36
7.4.160.0070.01016.46
7.4.150.0090.00917.40
7.4.140.0120.00517.86
7.4.130.0080.01216.49
7.4.120.0080.00816.62
7.4.110.0070.01616.24
7.4.100.0140.00316.71
7.4.90.0140.00516.49
7.4.80.0070.00819.37
7.4.70.0090.00916.52
7.4.60.0030.01316.45
7.4.50.0030.00516.30
7.4.40.0090.00916.53
7.4.30.0060.00916.39
7.4.00.0080.00815.10
7.3.330.0000.00613.32
7.3.320.0030.00313.16
7.3.310.0030.00316.20
7.3.300.0070.00016.18
7.3.290.0060.01016.38
7.3.280.0110.00516.32
7.3.270.0090.00917.40
7.3.260.0100.01016.29
7.3.250.0090.01116.43
7.3.240.0140.00316.39
7.3.230.0060.01016.57
7.3.210.0070.01016.26
7.3.200.0100.01019.39
7.3.190.0040.01416.23
7.3.180.0100.01316.38
7.3.170.0070.00916.43
7.3.160.0190.00016.52
7.3.120.0090.00814.84
7.3.110.0070.00914.94
7.3.100.0040.01114.84
7.3.90.0100.00414.74
7.3.80.0060.01114.83
7.3.70.0060.00714.76
7.3.60.0060.01014.96
7.3.50.0050.00814.75
7.3.40.0060.00814.77
7.3.30.0070.00714.78
7.3.20.0050.01016.71
7.3.10.0050.00716.57
7.3.00.0060.00716.50
7.2.330.0110.00716.38
7.2.320.0070.01416.64
7.2.310.0100.00716.76
7.2.300.0180.00016.54
7.2.290.0050.01616.61
7.2.250.0070.01115.14
7.2.240.0050.01414.86
7.2.230.0090.00715.06
7.2.220.0070.00814.88
7.2.210.0100.00414.96
7.2.200.0040.01014.90
7.2.190.0070.00615.00
7.2.180.0030.01214.91
7.2.170.0020.01114.94
7.2.130.0050.00916.63
7.2.120.0050.00816.79
7.2.110.0090.00416.63
7.2.100.0100.00316.50
7.2.90.0050.00716.83
7.2.80.0040.01016.66
7.2.70.0090.00816.69
7.2.60.0100.00716.78
7.2.50.0060.01116.59
7.2.40.0080.00816.99
7.2.30.0070.00716.73
7.2.20.0090.00716.69
7.2.10.0070.00816.80
7.2.00.0080.00717.44
7.1.330.0050.01015.73
7.1.320.0080.00615.59
7.1.310.0010.01215.56
7.1.300.0090.00415.63
7.1.290.0070.00515.54
7.1.280.0040.00815.61
7.1.270.0050.01115.62
7.1.260.0060.00615.65
7.1.250.0050.00515.36
7.1.230.0130.00415.71
7.1.220.0080.00815.23
7.1.210.0060.00915.58
7.1.200.0120.00415.56
7.1.190.0110.00815.56
7.1.180.0110.00715.48
7.1.170.0130.00015.57
7.1.160.0130.00415.49
7.1.150.0070.00715.34
7.1.140.0170.00315.71
7.1.130.0100.00715.63
7.1.120.0060.00915.63
7.1.110.0040.01015.53
7.1.100.0100.00816.66
7.1.90.0200.00615.86
7.1.80.0110.00515.83
7.1.70.0140.00616.19
7.1.60.0070.01717.52
7.1.50.0240.00825.22
7.1.40.0200.01015.79
7.1.30.0150.00515.61
7.1.20.0130.00715.76
7.1.10.0250.00015.67
7.1.00.0190.03819.00
7.0.310.0040.01215.05
7.0.300.0130.00315.13
7.0.290.0120.00415.42
7.0.280.0170.00015.35
7.0.270.0120.00614.98
7.0.260.0000.01315.05
7.0.250.0100.00715.23
7.0.240.0090.00715.18
7.0.230.0210.00415.39
7.0.220.0090.00915.44
7.0.210.0230.00915.29
7.0.200.0090.00616.08
7.0.190.0120.00815.43
7.0.180.0200.00315.46
7.0.170.0090.00315.29
7.0.160.0100.00315.39
7.0.150.0250.00515.34
7.0.140.0080.04018.57
7.0.130.0100.00215.01
7.0.120.0300.00015.16
7.0.110.0340.00015.39
7.0.100.0220.00715.42
7.0.90.0310.00815.47
7.0.80.0270.00015.32
7.0.70.0090.00615.44
7.0.60.0200.03117.53
7.0.50.0150.04316.69
7.0.40.0180.04216.86
7.0.30.0280.03016.69
7.0.20.0220.03716.66
7.0.10.0110.04416.63
7.0.00.0050.03116.80
5.6.380.0170.00013.93
5.6.370.0080.01114.12
5.6.360.0100.00514.30
5.6.350.0090.00914.16
5.6.340.0140.00314.16
5.6.330.0060.00914.02
5.6.320.0080.01013.95
5.6.310.0150.00614.41
5.6.300.0130.00314.23
5.6.290.0120.00814.09
5.6.280.0100.03317.52
5.6.270.0170.00014.04
5.6.260.0130.00013.92
5.6.250.0130.00014.14
5.6.240.0100.00514.03
5.6.230.0120.00814.06
5.6.220.0180.00014.48
5.6.210.0080.04017.27
5.6.200.0060.04116.04
5.6.190.0060.02717.39
5.6.180.0210.02317.31
5.6.170.0340.03417.56
5.6.160.0110.04317.31
5.6.150.0090.02816.19
5.6.140.0070.04516.20
5.6.130.0100.03416.24
5.6.120.0070.02217.71
5.6.110.0050.02417.54
5.6.100.0100.03217.53
5.6.90.0110.03617.68
5.6.80.0100.03817.27
5.6.70.0160.00314.01
5.6.60.0100.01114.04
5.6.50.0140.00013.92
5.6.40.0110.00613.90
5.6.30.0080.00913.89
5.6.20.0110.00813.98
5.6.10.0100.00314.11
5.6.00.0120.00314.07
5.5.380.0100.00010.93
5.5.370.0090.00311.12
5.5.360.0060.00311.12
5.5.350.0120.04315.72
5.5.340.0070.02514.49
5.5.330.0130.04015.65
5.5.320.0180.02215.70
5.5.310.0190.03915.73
5.5.300.0100.03314.33
5.5.290.0130.01514.58
5.5.280.0060.02315.91
5.5.270.0070.03215.95
5.5.260.0090.02115.82
5.5.250.0110.04315.87
5.5.240.0100.04515.45
5.5.230.0090.00310.68
5.5.220.0050.00511.02
5.5.210.0070.00310.93
5.5.200.0110.00010.96
5.5.190.0040.00410.61
5.5.180.0090.00310.95
5.5.170.0140.00914.16
5.5.160.0060.00611.15
5.5.150.0140.00010.81
5.5.140.0070.00711.06
5.5.130.0080.00810.98
5.5.120.0060.00310.75
5.5.110.0090.00410.76
5.5.100.0090.00211.04
5.5.90.0050.00510.97
5.5.80.0090.00210.61
5.5.70.0050.00811.04
5.5.60.0130.00010.88
5.5.50.0090.00510.75
5.5.40.0090.00510.61
5.5.30.0060.00611.06
5.5.20.0040.00910.72
5.5.10.0070.00711.19
5.5.00.0090.00010.94
5.4.450.0440.02814.85
5.4.440.0430.03315.09
5.4.430.0520.03215.26
5.4.420.0370.00215.16
5.4.410.0410.00015.30
5.4.400.0460.00215.10
5.4.390.0340.00315.06
5.4.380.0110.03514.81
5.4.370.0180.03414.69
5.4.360.0170.02714.79
5.4.350.0160.03014.76
5.4.340.0260.02514.82
5.4.330.0070.00310.71
5.4.320.0090.02011.76
5.4.310.0080.02011.66
5.4.300.0080.01811.56
5.4.290.0050.02311.65
5.4.280.0090.02211.61
5.4.270.0110.01911.72
5.4.260.0050.02511.74
5.4.250.0080.02011.60
5.4.240.0070.02111.65
5.4.230.0050.02211.74
5.4.220.0080.02411.60
5.4.210.0100.02111.59
5.4.200.0060.02511.62
5.4.190.0090.01911.70
5.4.180.0070.02411.75
5.4.170.0070.02111.64
5.4.160.0060.02611.58
5.4.150.0070.02011.57
5.4.140.0060.02311.49
5.4.130.0060.02111.40
5.4.120.0110.01611.62
5.4.110.0100.02111.32
5.4.100.0070.01811.42
5.4.90.0080.02111.44
5.4.80.0080.02111.49
5.4.70.0040.02211.39
5.4.60.0090.02011.39
5.4.50.0100.01811.33
5.4.40.0050.02211.45
5.4.30.0080.02111.50
5.4.20.0100.01811.54
5.4.10.0070.02111.52
5.4.00.0060.02311.18
5.3.290.0100.02611.71
5.3.280.0090.01911.66
5.3.270.0080.02011.67
5.3.260.0070.02311.66
5.3.250.0080.02111.67
5.3.240.0080.02411.67
5.3.230.0070.02511.66
5.3.220.0060.02811.65
5.3.210.0050.02511.65
5.3.200.0080.02411.65
5.3.190.0080.02411.65
5.3.180.0100.01911.64
5.3.170.0100.02411.64
5.3.160.0050.02711.64
5.3.150.0120.02211.64
5.3.140.0090.02011.64
5.3.130.0070.02811.63
5.3.120.0050.02411.63
5.3.110.0090.02211.63
5.3.100.0060.02411.38
5.3.90.0090.02411.36
5.3.80.0090.01811.36
5.3.70.0060.01811.36
5.3.60.0020.02411.35
5.3.50.0080.02111.32
5.3.40.0090.02111.32
5.3.30.0070.02811.30
5.3.20.0080.02011.19
5.3.10.0050.02511.18
5.3.00.0060.02911.17
5.2.170.0040.0199.93
5.2.160.0050.0179.93
5.2.150.0040.0259.93
5.2.140.0030.0199.93
5.2.130.0040.0249.90
5.2.120.0040.0169.90
5.2.110.0060.0229.90
5.2.100.0060.0219.90
5.2.90.0060.0189.90
5.2.80.0050.0249.90
5.2.70.0070.0219.90
5.2.60.0040.0199.88
5.2.50.0080.0219.86
5.2.40.0050.0219.85
5.2.30.0060.0239.84
5.2.20.0070.0169.83
5.2.10.0080.0189.79
5.2.00.0040.0179.72
5.1.60.0070.0129.36
5.1.50.0060.0149.36
5.1.40.0050.0149.35
5.1.30.0020.0199.52
5.1.20.0030.0169.53
5.1.10.0050.0189.40
5.1.00.0040.0209.40
5.0.50.0020.0158.64
5.0.40.0040.0118.57
5.0.30.0050.0218.48
5.0.20.0070.0138.46
5.0.10.0030.0188.45
5.0.00.0050.0208.45
4.4.90.0030.0097.70
4.4.80.0060.0107.68
4.4.70.0030.0097.68
4.4.60.0070.0097.69
4.4.50.0050.0117.69
4.4.40.0050.0157.66
4.4.30.0020.0167.69
4.4.20.0020.0137.73
4.4.10.0030.0167.73
4.4.00.0030.0197.69
4.3.110.0030.0097.64
4.3.100.0050.0107.64
4.3.90.0040.0137.62
4.3.80.0050.0157.60
4.3.70.0040.0097.62
4.3.60.0050.0107.62
4.3.50.0040.0147.62
4.3.40.0020.0187.58
4.3.30.0010.0156.96
4.3.20.0040.0106.95
4.3.10.0030.0116.92
4.3.00.0060.01112.46

preferences:
49.53 ms | 401 KiB | 5 Q