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); if(!is_array($temp)){ 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('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.0140.00718.50
8.3.50.0050.01421.21
8.3.40.0140.00418.98
8.3.30.0100.00618.96
8.3.20.0040.00420.11
8.3.10.0030.00522.08
8.3.00.0080.00020.61
8.2.180.0000.01416.63
8.2.170.0120.00322.96
8.2.160.0040.01119.25
8.2.150.0030.00524.18
8.2.140.0040.01124.66
8.2.130.0080.00026.16
8.2.120.0090.00019.08
8.2.110.0060.00322.20
8.2.100.0070.00419.25
8.2.90.0040.00419.35
8.2.80.0040.00418.05
8.2.70.0090.00017.63
8.2.60.0030.00517.93
8.2.50.0060.00318.07
8.2.40.0030.00518.22
8.2.30.0000.00718.09
8.2.20.0000.00817.91
8.2.10.0000.00717.79
8.2.00.0000.00917.83
8.1.270.0040.00418.55
8.1.260.0000.00826.35
8.1.250.0070.00028.09
8.1.240.0030.00623.75
8.1.230.0110.00019.09
8.1.220.0050.00317.78
8.1.210.0050.00318.77
8.1.200.0060.00317.35
8.1.190.0040.00417.55
8.1.180.0050.00318.75
8.1.170.0000.00818.55
8.1.160.0000.00722.08
8.1.150.0060.00318.59
8.1.140.0000.00817.36
8.1.130.0040.00417.72
8.1.120.0000.00817.53
8.1.110.0080.00317.37
8.1.100.0040.00417.45
8.1.90.0000.00717.46
8.1.80.0070.00017.48
8.1.70.0040.00417.43
8.1.60.0040.00417.46
8.1.50.0080.00017.41
8.1.40.0040.00417.49
8.1.30.0040.00417.48
8.1.20.0030.00517.64
8.1.10.0030.00617.58
8.1.00.0030.00517.58
8.0.300.0070.00018.77
8.0.290.0070.00017.05
8.0.280.0000.00718.53
8.0.270.0070.00017.16
8.0.260.0060.00018.45
8.0.250.0000.00716.96
8.0.240.0050.00416.95
8.0.230.0000.00816.93
8.0.220.0000.00716.87
8.0.210.0050.00316.95
8.0.200.0000.00617.04
8.0.190.0060.00317.03
8.0.180.0040.00417.04
8.0.170.0040.00417.02
8.0.160.0000.00817.02
8.0.150.0000.00817.02
8.0.140.0040.00416.96
8.0.130.0000.00613.40
8.0.120.0070.00016.93
8.0.110.0000.00816.94
8.0.100.0000.00717.05
8.0.90.0040.00416.87
8.0.80.0110.00417.00
8.0.70.0040.00417.07
8.0.60.0080.00016.85
8.0.50.0050.00316.88
8.0.30.0080.01017.10
8.0.20.0130.00517.44
8.0.10.0000.00717.07
8.0.00.0090.01216.78
7.4.330.0000.00615.00
7.4.320.0030.00316.61
7.4.300.0000.00716.62
7.4.290.0030.00416.46
7.4.280.0000.00716.64
7.4.270.0070.00016.63
7.4.260.0000.00716.50
7.4.250.0030.00316.48
7.4.240.0020.00516.55
7.4.230.0030.00316.43
7.4.220.0080.00816.71
7.4.210.0060.01016.57
7.4.200.0070.00016.70
7.4.190.0070.00016.75
7.4.160.0120.00616.70
7.4.150.0120.00617.40
7.4.140.0100.00917.86
7.4.130.0060.01316.53
7.4.120.0100.00816.71
7.4.110.0080.01016.66
7.4.100.0040.01516.47
7.4.90.0110.01116.56
7.4.80.0120.00919.39
7.4.70.0060.01316.57
7.4.60.0110.00716.46
7.4.50.0040.00416.50
7.4.40.0030.01222.77
7.4.30.0100.01316.52
7.4.00.0070.01015.19
7.3.330.0000.00513.52
7.3.320.0020.00213.39
7.3.310.0030.00316.30
7.3.300.0060.00016.28
7.3.290.0060.00916.45
7.3.280.0020.01316.37
7.3.270.0130.01017.40
7.3.260.0090.00816.67
7.3.250.0120.00916.63
7.3.240.0110.00616.61
7.3.230.0170.00016.39
7.3.210.0110.00716.58
7.3.200.0100.00719.39
7.3.190.0150.00616.48
7.3.180.0160.00016.46
7.3.170.0110.01016.42
7.3.160.0060.00916.48
7.3.120.0000.01115.10
7.2.330.0090.00916.52
7.2.320.0090.00916.59
7.2.310.0030.01316.84
7.2.300.0030.01216.84
7.2.290.0140.01016.46
7.2.00.0080.00819.61
7.1.100.0070.00718.21
7.1.70.0030.00817.28
7.1.60.0160.01019.82
7.1.50.0040.01117.11
7.1.00.0000.05322.50
7.0.200.0040.00716.74
7.0.140.0070.07322.10
7.0.60.0070.04319.91
7.0.50.0070.08017.91
7.0.40.0070.09020.09
7.0.30.0300.05720.24
7.0.20.0330.07720.21
7.0.10.0030.09320.23
7.0.00.0070.06320.16
5.6.280.0030.07321.05
5.6.210.0100.06720.77
5.6.200.0130.07318.20
5.6.190.0100.04020.77
5.6.180.0170.04020.63
5.6.170.0230.04720.47
5.6.160.0100.08320.71
5.6.150.0070.03718.12
5.6.140.0070.06018.15
5.6.130.0130.07018.19
5.6.120.0030.06021.12
5.6.110.0030.04720.98
5.6.100.0130.08321.14
5.6.90.0000.04321.08
5.6.80.0070.05320.41
5.5.350.0200.05020.34
5.5.340.0130.06718.07
5.5.330.0030.07320.23
5.5.320.0270.08020.25
5.5.310.0130.04720.27
5.5.300.0100.08018.04
5.5.290.0070.08717.95
5.5.280.0030.08020.89
5.5.270.0070.06720.86
5.5.260.0030.08320.86
5.5.250.0100.07320.79
5.5.240.0070.08020.37
5.4.450.0630.06019.48
5.4.440.0900.05319.64
5.4.430.0900.05319.44
5.4.420.0530.06019.64
5.4.410.0070.07318.86
5.4.400.0270.05718.76
5.4.390.0870.06318.78
5.4.380.0130.05018.70
5.4.370.0170.04318.84
5.4.360.0030.04318.69
5.4.350.0070.04612.02
5.4.340.0090.05512.02
5.4.320.0060.04312.50
5.4.310.0020.04612.50
5.4.300.0070.03912.51
5.4.290.0100.03512.50
5.4.280.0050.04112.40
5.4.270.0060.04012.40
5.4.260.0040.04012.40
5.4.250.0200.05718.77
5.4.240.0100.07018.66
5.4.230.0170.06718.94
5.4.220.0270.03718.80
5.4.210.0100.05018.77
5.4.200.0000.05718.95
5.4.190.0130.06718.73
5.4.180.0070.05018.99
5.4.170.0130.04718.79
5.4.160.0100.06018.99
5.4.150.0000.08018.99
5.4.140.0100.05016.59
5.4.130.0100.06716.58
5.4.120.0070.05016.60
5.4.110.0130.04716.33
5.4.100.0070.07316.50
5.4.90.0030.06016.41
5.4.80.0070.07316.47
5.4.70.0030.05316.46
5.4.60.0100.04716.34
5.4.50.0030.05316.38
5.4.40.0030.05016.52
5.4.30.0130.04316.59
5.4.20.0130.06716.33
5.4.10.0070.07316.50
5.4.00.0070.06715.84
5.3.290.0090.03912.80
5.3.280.0270.04014.55
5.3.270.0070.06014.62
5.3.260.0130.05714.51
5.3.250.0130.04314.51
5.3.240.0070.05014.70
5.3.230.0130.06314.68
5.3.220.0030.05714.48
5.3.210.0130.06014.65
5.3.200.0100.06714.65
5.3.190.0100.07014.79
5.3.180.0030.05714.70
5.3.170.0100.04714.75
5.3.160.0030.06714.57
5.3.150.0030.07314.56
5.3.140.0130.04314.69
5.3.130.0030.06314.77
5.3.120.0030.06014.64
5.3.110.0170.06714.61
5.3.100.0130.05014.02
5.3.90.0070.05314.15
5.3.80.0100.05714.00
5.3.70.0030.05014.09
5.3.60.0030.05314.18
5.3.50.0070.06013.94
5.3.40.0130.04714.03
5.3.30.0030.05313.98
5.3.20.0070.05013.68
5.3.10.0070.04713.63
5.3.00.0100.05713.72
5.2.170.0100.04011.23
5.2.160.0070.05711.10
5.2.150.0000.04711.22
5.2.140.0030.05311.32
5.2.130.0030.04011.18
5.2.120.0030.04711.09
5.2.110.0100.05010.94
5.2.100.0070.04011.08
5.2.90.0100.03711.28
5.2.80.0100.03711.18
5.2.70.0000.04711.31
5.2.60.0030.04311.13
5.2.50.0000.04710.86
5.2.40.0030.04011.09
5.2.30.0030.04011.19
5.2.20.0070.04011.04
5.2.10.0070.05010.95
5.2.00.0030.05010.88
5.1.60.0170.02010.00
5.1.50.0170.02010.07
5.1.40.0130.02710.02
5.1.30.0070.05010.39
5.1.20.0030.04010.58
5.1.10.0000.04010.12
5.1.00.0070.04310.32
5.0.50.0070.0278.75
5.0.40.0070.0338.44
5.0.30.0070.0408.31
5.0.20.0000.0378.21
5.0.10.0100.0278.23
5.0.00.0030.0408.25
4.4.90.0170.0177.36
4.4.80.0070.0177.36
4.4.70.0000.0237.36
4.4.60.0000.0237.36
4.4.50.0030.0207.36
4.4.40.0000.0377.36
4.4.30.0070.0207.36
4.4.20.0030.0237.36
4.4.10.0000.0237.36
4.4.00.0030.0507.36
4.3.110.0000.0237.36
4.3.100.0030.0177.36
4.3.90.0030.0207.36
4.3.80.0070.0277.36
4.3.70.0030.0207.36
4.3.60.0000.0277.36
4.3.50.0030.0307.36
4.3.40.0100.0237.36
4.3.30.0000.0277.36
4.3.20.0070.0207.36
4.3.10.0000.0377.36
4.3.00.0130.0207.12

preferences:
57.67 ms | 400 KiB | 5 Q