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); print_r( $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.0140.00318.28
8.3.50.0050.01021.02
8.3.40.0110.01118.83
8.3.30.0150.00619.12
8.3.20.0090.00020.14
8.3.10.0040.00422.09
8.3.00.0040.00420.76
8.2.180.0120.00316.75
8.2.170.0100.01022.96
8.2.160.0060.00819.34
8.2.150.0000.00824.18
8.2.140.0110.00424.66
8.2.130.0100.00326.16
8.2.120.0070.00019.67
8.2.110.0060.00322.21
8.2.100.0050.00519.39
8.2.90.0000.00819.34
8.2.80.0040.00418.05
8.2.70.0000.00917.62
8.2.60.0000.00818.04
8.2.50.0030.00618.07
8.2.40.0000.00718.22
8.2.30.0050.00318.03
8.2.20.0040.00417.73
8.2.10.0040.00417.77
8.2.00.0080.00317.79
8.1.280.0110.00425.92
8.1.270.0080.00018.63
8.1.260.0000.00726.35
8.1.250.0070.00028.09
8.1.240.0040.00423.97
8.1.230.0080.00418.96
8.1.220.0000.00817.74
8.1.210.0030.00618.77
8.1.200.0060.00317.22
8.1.190.0000.00817.53
8.1.180.0060.00318.75
8.1.170.0040.00418.66
8.1.160.0070.00022.08
8.1.150.0040.00418.66
8.1.140.0070.00017.41
8.1.130.0100.00017.85
8.1.120.0030.00317.43
8.1.110.0030.00617.36
8.1.100.0000.00717.32
8.1.90.0070.00017.49
8.1.80.0030.00317.55
8.1.70.0030.00317.35
8.1.60.0030.00617.67
8.1.50.0050.00317.43
8.1.40.0040.00417.45
8.1.30.0040.00417.71
8.1.20.0040.00417.71
8.1.10.0060.00617.61
8.1.00.0040.00417.55
8.0.300.0000.00718.77
8.0.290.0030.00517.16
8.0.280.0070.00018.52
8.0.270.0030.00317.36
8.0.260.0000.00816.84
8.0.250.0030.00316.98
8.0.240.0030.00617.00
8.0.230.0030.00316.93
8.0.220.0040.00416.96
8.0.210.0040.00317.00
8.0.200.0000.00616.96
8.0.190.0020.00517.00
8.0.180.0000.00716.96
8.0.170.0040.00416.98
8.0.160.0000.00716.88
8.0.150.0030.00516.79
8.0.140.0040.00316.78
8.0.130.0060.00013.34
8.0.120.0080.00016.78
8.0.110.0000.00816.86
8.0.100.0000.00816.89
8.0.90.0040.00416.97
8.0.80.0100.01316.87
8.0.70.0000.00816.81
8.0.60.0040.00416.99
8.0.50.0050.00216.79
8.0.30.0140.00517.14
8.0.20.0100.01017.40
8.0.10.0000.00816.91
8.0.00.0080.01216.79
7.4.330.0000.00515.00
7.4.320.0000.00616.52
7.4.300.0040.00416.59
7.4.290.0000.00816.49
7.4.280.0050.00316.62
7.4.270.0030.00316.55
7.4.260.0000.00716.61
7.4.250.0040.00416.61
7.4.240.0000.00716.56
7.4.230.0000.00716.33
7.4.220.0090.01116.67
7.4.210.0070.00916.59
7.4.200.0060.00316.57
7.4.190.0040.00416.57
7.4.160.0090.00616.54
7.4.150.0150.00817.40
7.4.140.0110.00917.86
7.4.130.0110.01316.46
7.4.120.0160.00416.52
7.4.110.0130.00316.50
7.4.100.0000.02216.47
7.4.90.0090.00916.60
7.4.80.0100.00619.39
7.4.70.0040.01316.54
7.4.60.0040.01516.41
7.4.50.0060.00316.45
7.4.40.0040.01522.77
7.4.30.0090.00616.63
7.4.00.0070.00714.73
7.3.330.0000.00513.41
7.3.320.0000.00613.46
7.3.310.0030.00316.37
7.3.300.0000.00616.40
7.3.290.0070.00716.37
7.3.280.0060.00816.32
7.3.270.0100.01317.40
7.3.260.0120.00616.54
7.3.250.0120.00616.45
7.3.240.0160.00316.41
7.3.230.0160.00316.39
7.3.210.0070.01016.43
7.3.200.0130.00419.39
7.3.190.0140.00716.63
7.3.180.0080.00816.59
7.3.170.0080.00716.38
7.3.160.0060.01016.60
7.3.120.0100.00315.02
7.2.330.0070.01016.69
7.2.320.0090.01316.73
7.2.310.0070.01016.72
7.2.300.0130.01016.46
7.2.290.0080.00816.65
7.2.00.0060.00919.46
7.1.200.0100.00315.62
7.1.100.0060.00618.09
7.1.70.0040.00816.91
7.1.60.0060.00919.82
7.1.50.0080.00817.10
7.1.00.0070.03022.40
7.0.200.0120.00616.88
7.0.140.0030.07321.95
7.0.60.0230.06319.87
7.0.50.0100.07317.92
7.0.40.0030.05319.96
7.0.30.0270.08020.13
7.0.20.0370.06720.20
7.0.10.0100.08020.09
7.0.00.0070.07020.20
5.6.280.0070.07020.79
5.6.210.0000.07020.66
5.6.200.0130.08018.17
5.6.190.0070.06720.43
5.6.180.0400.07720.41
5.6.170.0370.07020.39
5.6.160.0100.04320.47
5.6.150.0070.08018.12
5.6.140.0070.03718.11
5.6.130.0030.05018.15
5.6.120.0070.05721.01
5.6.110.0070.08020.99
5.6.100.0030.04720.99
5.6.90.0030.05021.03
5.6.80.0130.07320.38
5.5.350.4000.04320.40
5.5.340.0070.04318.09
5.5.330.0030.04720.21
5.5.320.0100.04320.34
5.5.310.0130.04020.27
5.5.300.0030.08717.95
5.5.290.0130.06017.95
5.5.280.0030.08020.78
5.5.270.0070.04020.74
5.5.260.0000.04320.85
5.5.250.0070.05720.63
5.5.240.0230.06320.36
5.4.450.0430.06019.41
5.4.440.0330.04019.19
5.4.430.0530.07019.50
5.4.420.0570.04319.17
5.4.410.0570.05319.14
5.4.400.0370.04019.23
5.4.390.0470.05019.09
5.4.380.0570.06018.99
5.4.370.0500.04018.98
5.4.360.0500.05719.01
5.4.350.0430.04019.20
5.4.340.0530.05319.10
5.4.320.0300.04018.98
5.4.310.0370.04018.87
5.4.300.0370.03019.19
5.4.290.0300.03719.22
5.4.280.0270.04019.06
5.4.270.0470.03319.08
5.4.260.0330.03718.97
5.4.250.0370.07019.08
5.4.240.0400.04019.23
5.4.230.0370.03319.24
5.4.220.0330.05319.19
5.4.210.0370.03018.98
5.4.200.0400.04019.06
5.4.190.0370.03319.15
5.4.180.0300.04019.14
5.4.170.0400.03318.93
5.4.160.0270.04019.14
5.4.150.0330.03719.29
5.4.140.0300.03716.33
5.4.130.0300.03716.49
5.4.120.0300.03316.36
5.4.110.0330.04016.38
5.4.100.0330.03716.48
5.4.90.0330.04316.51
5.4.80.0370.03016.56
5.4.70.0370.04016.50
5.4.60.0330.04016.25
5.4.50.0370.03716.54
5.4.40.0470.05716.39
5.4.30.0370.03316.42
5.4.20.0500.05016.51
5.4.10.0430.04016.24
5.4.00.0470.06015.96
5.3.290.0270.04314.75
5.3.280.0330.03714.76
5.3.270.0300.03714.70
5.3.260.0300.04314.60
5.3.250.0300.03714.62
5.3.240.0370.04014.61
5.3.230.0330.04014.70
5.3.220.0400.03014.80
5.3.210.0230.05014.59
5.3.200.0330.03314.82
5.3.190.0370.03714.64
5.3.180.0330.04314.49
5.3.170.0330.04314.70
5.3.160.0430.03314.62
5.3.150.0400.06714.73
5.3.140.0500.03314.57
5.3.130.0430.04014.57
5.3.120.0300.04014.54
5.3.110.0370.05714.67
5.3.100.0730.03013.96
5.3.90.0430.05013.94
5.3.80.0530.06013.96
5.3.70.0530.06313.96
5.3.60.0430.06013.93
5.3.50.0430.05713.93
5.3.40.0370.04313.93
5.3.30.0430.05313.93
5.3.20.0300.03713.70
5.3.10.0370.03013.68
5.3.00.0300.05313.73
5.2.170.0330.05711.07
5.2.160.0270.03711.08
5.2.150.0330.03711.08
5.2.140.0230.04311.11
5.2.130.0400.05711.03
5.2.120.0270.02711.09
5.2.110.0230.04011.19
5.2.100.0330.05311.02
5.2.90.0370.04711.02
5.2.80.0400.05711.26
5.2.70.0270.03011.19
5.2.60.0370.05011.07
5.2.50.0200.03710.94
5.2.40.0200.04010.92
5.2.30.0270.02310.98
5.2.20.0200.03711.05
5.2.10.0230.05311.09
5.2.00.0200.04010.89
5.1.60.0270.0209.99
5.1.50.0270.0279.99
5.1.40.0330.0309.90
5.1.30.0400.04310.25
5.1.20.0300.06010.27
5.1.10.0400.04310.00
5.1.00.0330.04010.09
5.0.50.0200.0338.49
5.0.40.0170.0278.32
5.0.30.0170.0638.32
5.0.20.0230.0378.30
5.0.10.0130.0238.26
5.0.00.0170.0438.15
4.4.90.0070.0207.54
4.4.80.0100.0207.54
4.4.70.0100.0177.54
4.4.60.0130.0337.54
4.4.50.0170.0237.54
4.4.40.0200.0207.54
4.4.30.0170.0377.54
4.4.20.0200.0237.54
4.4.10.0130.0307.54
4.4.00.0200.0307.54
4.3.110.0130.0207.54
4.3.100.0130.0377.54
4.3.90.0130.0177.54
4.3.80.0200.0477.54
4.3.70.0130.0177.54
4.3.60.0130.0237.54
4.3.50.0170.0177.54
4.3.40.0200.0477.54
4.3.30.0070.0237.54
4.3.20.0100.0177.54
4.3.10.0100.0177.54
4.3.00.0070.0207.54

preferences:
47.16 ms | 401 KiB | 5 Q