3v4l.org

run code in 300+ PHP versions simultaneously
<?php function swift_rgb2hex($rgb,$hash=true) { if($rgb == NULL){ return 'none'; } if($hash) $hex = '#'; $temp = explode('(',$rgb); echo $temp; if(!is_array($temp) || count($temp)<=1){ return $rgb; } $rgb = $temp[1]; $temp = explode(')',$rgb); $rgb = $temp[0]; $rgb = explode(',',$rgb); $hex .= str_pad(dechex($rgb[0]), 2, "0", STR_PAD_LEFT); $hex .= str_pad(dechex($rgb[1]), 2, "0", STR_PAD_LEFT); $hex .= str_pad(dechex($rgb[2]), 2, "0", STR_PAD_LEFT); return $hex; } /* echo swift_rgb2hex('rgba(0,0,0)'); echo swift_rgb2hex('rgba(255,255,0)'); echo swift_rgb2hex('boom'); echo swift_rgb2hex('FFFFFF'); */ echo swift_rgb2hex('rgba(0,0,0)');

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.0070.00718.40
8.3.50.0110.00521.07
8.3.40.0000.01418.98
8.3.30.0070.00719.04
8.3.20.0040.00420.34
8.3.10.0070.00021.95
8.3.00.0000.00820.71
8.2.180.0060.00916.50
8.2.170.0070.00722.96
8.2.160.0030.01019.29
8.2.150.0060.00324.18
8.2.140.0090.00624.66
8.2.130.0000.01426.16
8.2.120.0040.00419.54
8.2.110.0030.00622.07
8.2.100.0110.00019.32
8.2.90.0060.00319.39
8.2.80.0060.00318.05
8.2.70.0030.00617.75
8.2.60.0050.00318.05
8.2.50.0000.00818.07
8.2.40.0000.00718.34
8.2.30.0000.00718.03
8.2.20.0000.00717.62
8.2.10.0000.00817.76
8.2.00.0070.00317.64
8.1.280.0070.00725.92
8.1.270.0060.00318.65
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0030.00623.84
8.1.230.0040.00819.10
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0040.00417.35
8.1.190.0000.00817.53
8.1.180.0040.00418.69
8.1.170.0040.00418.69
8.1.160.0070.00022.16
8.1.150.0030.00518.71
8.1.140.0040.00417.47
8.1.130.0090.00017.76
8.1.120.0030.00317.32
8.1.110.0030.00617.37
8.1.100.0000.00717.41
8.1.90.0000.00717.51
8.1.80.0030.00517.46
8.1.70.0080.00017.43
8.1.60.0070.00317.60
8.1.50.0040.00417.48
8.1.40.0030.00517.42
8.1.30.0040.00417.50
8.1.20.0050.00317.63
8.1.10.0040.00717.57
8.1.00.0040.00417.60
8.0.300.0040.00418.77
8.0.290.0070.00017.16
8.0.280.0000.00718.48
8.0.270.0030.00317.34
8.0.260.0040.00418.63
8.0.250.0030.00316.91
8.0.240.0080.00316.92
8.0.230.0000.00717.03
8.0.220.0000.00717.02
8.0.210.0030.00316.89
8.0.200.0000.00717.05
8.0.190.0030.00617.00
8.0.180.0040.00416.96
8.0.170.0080.00017.00
8.0.160.0040.00416.95
8.0.150.0000.00816.80
8.0.140.0040.00316.81
8.0.130.0030.00313.46
8.0.120.0000.00816.89
8.0.110.0050.00316.97
8.0.100.0040.00416.90
8.0.90.0000.00716.86
8.0.80.0070.00717.03
8.0.70.0040.00416.85
8.0.60.0000.00816.89
8.0.50.0000.00716.86
8.0.30.0080.01117.20
8.0.20.0120.00617.40
8.0.10.0020.00517.00
8.0.00.0050.01416.70
7.4.330.0020.00215.00
7.4.320.0030.00316.55
7.4.300.0000.00716.50
7.4.290.0030.00316.62
7.4.280.0030.00316.63
7.4.270.0060.00016.53
7.4.260.0000.00816.59
7.4.250.0050.00216.49
7.4.240.0020.00516.59
7.4.230.0030.00316.41
7.4.220.0070.01116.64
7.4.210.0080.00716.61
7.4.200.0030.00616.65
7.4.190.0000.00716.63
7.4.160.0100.00716.70
7.4.150.0140.00717.40
7.4.140.0030.01617.86
7.4.130.0060.01116.71
7.4.120.0110.01116.65
7.4.110.0100.00716.63
7.4.100.0070.01016.55
7.4.90.0070.01116.56
7.4.80.0110.00519.39
7.4.70.0120.00616.31
7.4.60.0110.00716.60
7.4.50.0050.00316.38
7.4.40.0070.01122.77
7.4.30.0110.00416.48
7.4.00.0060.00914.95
7.3.330.0000.00513.40
7.3.320.0000.00513.29
7.3.310.0060.00016.43
7.3.300.0060.00016.35
7.3.290.0120.00316.38
7.3.280.0080.00816.40
7.3.270.0070.01017.40
7.3.260.0070.01016.59
7.3.250.0100.01016.45
7.3.240.0120.01216.45
7.3.230.0080.00916.56
7.3.210.0140.00316.58
7.3.200.0060.01519.39
7.3.190.0120.00916.74
7.3.180.0110.00516.68
7.3.170.0140.00316.48
7.3.160.0090.00616.63
7.3.120.0070.00714.68
7.2.330.0140.00316.68
7.2.320.0090.01316.74
7.2.310.0100.00616.82
7.2.300.0080.00816.70
7.2.290.0130.00316.48
7.2.60.0030.01316.99
7.2.00.0070.00719.43
7.1.200.0030.00915.80
7.1.100.0080.00518.10
7.1.70.0030.00917.18
7.1.60.0070.01719.82
7.1.50.0040.01116.98
7.1.00.0000.07722.33
7.0.200.0090.00616.83
7.0.140.0130.06722.19
7.0.60.0070.05019.91
7.0.50.0100.05717.91
7.0.40.0030.05020.11
7.0.30.0370.07320.30
7.0.20.0230.04720.16
7.0.10.0000.04720.20
7.0.00.0030.09020.18
5.6.280.0000.07721.11
5.6.210.0100.07720.77
5.6.200.0070.08718.29
5.6.190.0030.05720.55
5.6.180.0430.07320.63
5.6.170.0200.05320.55
5.6.160.0070.04720.45
5.6.150.0100.08018.17
5.6.140.0070.04718.14
5.6.130.0130.07018.14
5.6.120.0100.08020.98
5.6.110.0030.05021.12
5.6.100.0030.09020.98
5.6.90.0030.09321.10
5.6.80.0070.04020.41
5.5.350.0200.08320.48
5.5.340.0030.08017.96
5.5.330.0100.08020.27
5.5.320.0330.04020.34
5.5.310.0230.07020.24
5.5.300.0030.04018.05
5.5.290.0070.07718.08
5.5.280.0130.07720.88
5.5.270.0100.07020.88
5.5.260.0100.07320.88
5.5.250.0100.04020.63
5.5.240.0000.08020.27
5.4.450.0700.05719.36
5.4.440.0600.07719.16
5.4.430.0930.07319.38
5.4.420.0800.06019.16
5.4.410.1100.06019.34
5.4.400.0800.05319.29
5.4.390.0900.06019.12
5.4.380.0400.05718.71
5.4.370.0200.04718.59
5.4.360.0230.04018.70
5.4.350.0030.04212.03
5.4.340.0080.04512.03
5.4.320.0050.03812.52
5.4.310.0080.03912.51
5.4.300.0180.05312.51
5.4.290.0070.04112.51
5.4.280.0100.04212.41
5.4.270.0080.03712.41
5.4.260.0100.03412.41
5.4.250.0100.05018.94
5.4.240.0100.05018.84
5.4.230.0030.05718.99
5.4.220.0100.07319.02
5.4.210.0070.07018.95
5.4.200.0070.05718.92
5.4.190.0000.06018.96
5.4.180.0130.04318.79
5.4.170.0100.06718.76
5.4.160.0030.05318.99
5.4.150.0030.06018.84
5.4.140.0100.07316.59
5.4.130.0100.04716.54
5.4.120.0130.07016.35
5.4.110.0070.05016.44
5.4.100.0230.04716.57
5.4.90.0130.04316.56
5.4.80.0070.07016.48
5.4.70.0100.05016.34
5.4.60.0000.05716.39
5.4.50.0130.06316.48
5.4.40.0130.06716.43
5.4.30.0100.06016.48
5.4.20.0030.06316.32
5.4.10.0070.06316.50
5.4.00.0030.06016.00
5.3.290.0070.04112.80
5.3.280.0030.05314.71
5.3.270.0200.05014.70
5.3.260.0130.05314.69
5.3.250.0100.07014.70
5.3.240.0070.06714.84
5.3.230.0100.05014.79
5.3.220.0100.05714.50
5.3.210.0170.05714.66
5.3.200.0170.04714.80
5.3.190.0070.06314.80
5.3.180.0070.07014.79
5.3.170.0100.07014.66
5.3.160.0000.05714.68
5.3.150.0100.05714.59
5.3.140.0000.07314.70
5.3.130.0130.07314.64
5.3.120.0170.04714.41
5.3.110.0170.05314.77
5.3.100.0170.05714.13
5.3.90.0130.04314.03
5.3.80.0170.04014.11
5.3.70.0100.05713.93
5.3.60.0130.04314.09
5.3.50.0030.05313.95
5.3.40.0070.05314.19
5.3.30.0030.06714.00
5.3.20.0070.06013.54
5.3.10.0030.07013.75
5.3.00.0070.05013.64
5.2.170.0070.03711.14
5.2.160.0000.05311.14
5.2.150.0130.05011.29
5.2.140.0030.04310.98
5.2.130.0070.04010.95
5.2.120.0070.04011.20
5.2.110.0130.04711.09
5.2.100.0100.05311.28
5.2.90.0130.04311.19
5.2.80.0070.04711.18
5.2.70.0170.04710.93
5.2.60.0170.03311.04
5.2.50.0070.05711.21
5.2.40.0070.05310.98
5.2.30.0030.04310.93
5.2.20.0130.03311.04
5.2.10.0030.04010.94
5.2.00.0130.05010.69
5.1.60.0100.02710.10
5.1.50.0070.03710.16
5.1.40.0070.0479.82
5.1.30.0100.03010.27
5.1.20.0030.05310.45
5.1.10.0070.03710.27
5.1.00.0130.03710.08
5.0.50.0070.0308.39
5.0.40.0030.0278.50
5.0.30.0030.0578.29
5.0.20.0000.0408.21
5.0.10.0030.0278.34
5.0.00.0030.0438.09
4.4.90.0030.0207.12
4.4.80.0130.0207.11
4.4.70.0030.0307.11
4.4.60.0000.0237.11
4.4.50.0030.0307.11
4.4.40.0030.0337.11
4.4.30.0070.0177.11
4.4.20.0000.0277.10
4.4.10.0030.0277.10
4.4.00.0070.0307.10
4.3.110.0000.0307.10
4.3.100.0070.0207.10
4.3.90.0100.0207.10
4.3.80.0100.0237.10
4.3.70.0030.0207.10
4.3.60.0000.0307.09
4.3.50.0000.0237.09
4.3.40.0070.0407.09
4.3.30.0030.0277.09
4.3.20.0030.0307.08
4.3.10.0030.0207.08
4.3.00.0100.0278.53

preferences:
43.87 ms | 401 KiB | 5 Q