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); var_dump($temp); if(!is_array($temp)){ return $rgb; } $rgb = $temp[1]; $rgb = explode(')',$rgb)[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.40.0060.00918.70
8.3.30.0110.00319.04
8.3.20.0040.00420.16
8.3.10.0030.00522.09
8.3.00.0030.00620.67
8.2.170.0070.00722.96
8.2.160.0040.01119.34
8.2.150.0080.00024.18
8.2.140.0090.00624.66
8.2.130.0100.01026.16
8.2.120.0090.00019.69
8.2.110.0090.00022.17
8.2.100.0080.00419.40
8.2.90.0040.00419.27
8.2.80.0000.00818.05
8.2.70.0060.00317.61
8.2.60.0040.00418.04
8.2.50.0060.00318.07
8.2.40.0000.00818.34
8.2.30.0040.00418.02
8.2.20.0040.00417.68
8.2.10.0050.00217.83
8.2.00.0030.00717.83
8.1.270.0070.00420.23
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0060.00323.83
8.1.230.0070.00719.16
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0100.00017.35
8.1.190.0030.00617.51
8.1.180.0040.00418.88
8.1.170.0040.00418.46
8.1.160.0040.00422.09
8.1.150.0000.00818.54
8.1.140.0070.00017.55
8.1.130.0000.00917.77
8.1.120.0040.00417.35
8.1.110.0070.00317.52
8.1.100.0020.00517.44
8.1.90.0000.00817.54
8.1.80.0000.00717.50
8.1.70.0000.00717.46
8.1.60.0030.00617.57
8.1.50.0080.00017.44
8.1.40.0000.00817.46
8.1.30.0000.00917.48
8.1.20.0000.00817.65
8.1.10.0030.00717.59
8.1.00.0040.00417.54
8.0.300.0040.00418.77
8.0.290.0070.00017.28
8.0.280.0030.00318.47
8.0.270.0070.00017.19
8.0.260.0000.00716.92
8.0.250.0030.00317.11
8.0.240.0050.00517.06
8.0.230.0030.00317.02
8.0.220.0030.00316.86
8.0.210.0050.00316.89
8.0.200.0110.00016.90
8.0.190.0040.00417.09
8.0.180.0040.00416.96
8.0.170.0040.00417.02
8.0.160.0030.00616.89
8.0.150.0050.00216.89
8.0.140.0000.00716.90
8.0.130.0000.00613.37
8.0.120.0060.00316.98
8.0.110.0000.00716.89
8.0.100.0070.00017.02
8.0.90.0080.00017.05
8.0.80.0000.01517.01
8.0.70.0070.00016.81
8.0.60.0000.00717.00
8.0.50.0040.00416.85
8.0.30.0160.00517.16
8.0.20.0120.01417.40
8.0.10.0050.00217.04
8.0.00.0100.00816.75
7.4.330.0050.00015.00
7.4.320.0060.00016.66
7.4.300.0030.00316.51
7.4.290.0000.00816.58
7.4.280.0000.01016.61
7.4.270.0000.00716.63
7.4.260.0040.00416.65
7.4.250.0040.00416.57
7.4.240.0060.00216.44
7.4.230.0030.00316.61
7.4.220.0150.00916.49
7.4.210.0080.00616.55
7.4.200.0040.00416.66
7.4.190.0000.00716.60
7.4.160.0100.00716.58
7.4.150.0110.00717.40
7.4.140.0090.01017.86
7.4.130.0130.00516.55
7.4.120.0140.00316.57
7.4.110.0070.01116.55
7.4.100.0090.00616.69
7.4.90.0090.01016.67
7.4.80.0070.01019.39
7.4.70.0060.01016.36
7.4.60.0130.00616.54
7.4.50.0050.00016.48
7.4.40.0150.00222.77
7.4.30.0040.01216.33
7.4.00.0100.00815.09
7.3.330.0000.00613.52
7.3.320.0030.00313.48
7.3.310.0030.00316.53
7.3.300.0070.00016.42
7.3.290.0110.00716.45
7.3.280.0080.00716.44
7.3.270.0120.00617.40
7.3.260.0090.00916.34
7.3.250.0110.00716.45
7.3.240.0110.00616.41
7.3.230.0100.01016.65
7.3.210.0130.00416.68
7.3.200.0040.01319.39
7.3.190.0110.00716.43
7.3.180.0120.00416.59
7.3.170.0080.00816.46
7.3.160.0120.00616.36
7.3.120.0060.00914.72
7.3.110.0040.01114.79
7.3.100.0000.01715.02
7.3.90.0110.00615.09
7.3.80.0060.00614.72
7.3.70.0090.00614.83
7.3.60.0040.00714.94
7.3.50.0130.00014.98
7.3.40.0030.01314.73
7.3.30.0060.01014.79
7.3.20.0040.00716.64
7.3.10.0060.00616.54
7.3.00.0110.00416.60
7.2.330.0060.01216.61
7.2.320.0060.01416.82
7.2.310.0060.01616.71
7.2.300.0030.01316.51
7.2.290.0030.01316.87
7.2.250.0150.00614.75
7.2.240.0000.01815.03
7.2.230.0100.00714.96
7.2.220.0100.00315.00
7.2.210.0070.00315.01
7.2.200.0000.01215.22
7.2.190.0000.00915.13
7.2.180.0130.00314.89
7.2.170.0060.00915.07
7.2.00.0060.01019.24
7.1.330.0100.00715.96
7.1.320.0030.00615.94
7.1.310.0070.00715.93
7.1.300.0040.01115.86
7.1.290.0100.00315.96
7.1.280.0060.00915.98
7.1.270.0060.00615.91
7.1.260.0030.01215.86
7.1.200.0000.01415.59
7.1.100.0030.00817.99
7.1.70.0030.00517.16
7.1.60.0060.01019.82
7.1.50.0040.01116.85
7.1.00.0000.07722.36
7.0.200.0070.00716.74
7.0.140.0070.06322.15
7.0.60.0170.05719.91
7.0.50.0030.06017.87
7.0.40.0030.08320.20
7.0.30.0270.07720.25
7.0.20.0230.03720.15
7.0.10.0070.09320.10
7.0.00.0030.04320.22
5.6.280.0030.07020.94
5.6.210.0030.07720.55
5.6.200.0130.07718.19
5.6.190.0130.08020.41
5.6.180.0330.05320.63
5.6.170.0270.08320.54
5.6.160.0100.06720.57
5.6.150.0070.08318.14
5.6.140.0130.07318.15
5.6.130.0000.04318.25
5.6.120.0000.04320.88
5.6.110.0070.04021.00
5.6.100.0070.08321.00
5.6.90.0100.07320.98
5.6.80.0030.06720.54
5.5.350.0170.07020.45
5.5.340.0070.07017.98
5.5.330.0000.06320.40
5.5.320.0330.06020.27
5.5.310.0200.05020.35
5.5.300.0070.06718.01
5.5.290.0100.03318.07
5.5.280.0070.08320.98
5.5.270.0100.07720.87
5.5.260.0130.06320.84
5.5.250.0130.06720.69
5.5.240.0230.07320.16
5.4.450.0500.05019.18
5.4.440.0170.04319.29
5.4.430.0200.04019.32
5.4.420.0200.03719.56
5.4.410.0130.04319.42
5.4.400.0130.04719.12
5.4.390.0130.04019.09
5.4.380.0170.03719.13
5.4.370.0200.04319.24
5.4.360.0170.04019.16
5.4.350.0270.04019.14
5.4.340.0270.03018.94
5.4.320.0200.03718.98
5.4.310.0200.03318.85
5.4.300.0200.04318.85
5.4.290.0170.07318.95
5.4.280.0370.03019.16
5.4.270.0200.07318.99
5.4.260.0230.07019.13
5.4.250.0200.04718.94
5.4.240.0200.04719.08
5.4.230.0230.07319.31
5.4.220.0270.04018.97
5.4.210.0230.06719.22
5.4.200.0470.06018.98
5.4.190.0170.04319.00
5.4.180.0270.03319.21
5.4.170.0300.06718.93
5.4.160.0270.04319.17
5.4.150.0230.04319.09
5.4.140.0300.06716.29
5.4.130.0200.04316.35
5.4.120.0370.03316.49
5.4.110.0230.05316.59
5.4.100.0270.07016.41
5.4.90.0300.07016.52
5.4.80.0270.06716.34
5.4.70.0400.06016.43
5.4.60.0300.05316.54
5.4.50.0300.06016.43
5.4.40.0330.06316.49
5.4.30.0500.02716.51
5.4.20.0300.05716.37
5.4.10.0300.06716.32
5.4.00.0200.04015.90
5.3.290.0200.03314.67
5.3.280.0230.07314.67
5.3.270.0370.06314.77
5.3.260.0270.04714.85
5.3.250.0400.03314.54
5.3.240.0330.06014.70
5.3.230.0300.06714.71
5.3.220.0170.05014.79
5.3.210.0230.03714.65
5.3.200.0270.07014.57
5.3.190.0400.04014.61
5.3.180.0370.06314.48
5.3.170.0330.04714.65
5.3.160.0230.05314.65
5.3.150.0270.04314.55
5.3.140.0230.05014.55
5.3.130.0300.07014.67
5.3.120.0400.06014.55
5.3.110.0400.06014.57
5.3.100.0230.06014.12
5.3.90.0430.03013.95
5.3.80.0200.08014.04
5.3.70.0200.04314.04
5.3.60.0200.03714.02
5.3.50.0270.06314.02
5.3.40.0330.03014.04
5.3.30.0300.03314.02
5.3.20.0330.06313.55
5.3.10.0230.07013.73
5.3.00.0230.05713.64
5.2.170.0170.06712.25
5.2.160.0200.03712.25
5.2.150.0270.06012.25
5.2.140.0270.05012.25
5.2.130.0170.06012.25
5.2.120.0300.05012.25
5.2.110.0230.06012.25
5.2.100.0270.03012.25
5.2.90.0200.04012.25
5.2.80.0230.04712.25
5.2.70.0170.05012.25
5.2.60.0230.04312.25
5.2.50.0170.04312.25
5.2.40.0170.06712.25
5.2.30.0230.05012.25
5.2.20.0200.06012.25
5.2.10.0230.05012.25
5.2.00.0230.04012.25
5.1.60.0230.03712.25
5.1.50.0230.04012.25
5.1.40.0170.03712.25
5.1.30.0230.04712.25
5.1.20.0170.03312.25
5.1.10.0230.04712.25
5.1.00.0200.03312.25
5.0.50.0070.02712.25
5.0.40.0100.02312.25
5.0.30.0130.06012.25
5.0.20.0070.04012.25
5.0.10.0130.02012.25
5.0.00.0070.06712.25
4.4.90.0100.02312.25
4.4.80.0100.03312.25
4.4.70.0100.03312.25
4.4.60.0070.03312.25
4.4.50.0100.03712.25
4.4.40.0100.05712.25
4.4.30.0100.01712.25
4.4.20.0100.01712.25
4.4.10.0070.04012.25
4.4.00.0170.04712.25
4.3.110.0100.01712.25
4.3.100.0130.03312.25
4.3.90.0100.01712.25
4.3.80.0100.03712.25
4.3.70.0100.03312.25
4.3.60.0070.02712.25
4.3.50.0100.02312.25
4.3.40.0130.02712.25
4.3.30.0070.03012.25
4.3.20.0030.03012.25
4.3.10.0000.03012.25
4.3.00.0070.03012.25

preferences:
39.66 ms | 400 KiB | 5 Q