3v4l.org

run code in 300+ PHP versions simultaneously
<?php function HSL2RGB($h, $s, $l) { $s = max(0, min($s, 100)); $l = max(0, min($l, 100)); $s = $s/100; $l = $l/100; $h = $h >= 360 ? $h % 360 : $h; $c = ( 1 - abs( 2 * $l - 1 ) ) * $s; $x = $c * ( 1 - abs( fmod( ( $h / 60 ), 2 ) - 1 ) ); $m = $l - ( $c / 2 ); if ( $h < 60 ) { $r = $c; $g = $x; $b = 0; } else if ( $h < 120 ) { $r = $x; $g = $c; $b = 0; } else if ( $h < 180 ) { $r = 0; $g = $c; $b = $x; } else if ( $h < 240 ) { $r = 0; $g = $x; $b = $c; } else if ( $h < 300 ) { $r = $x; $g = 0; $b = $c; } else { $r = $c; $g = 0; $b = $x; } $r = ( $r + $m ) * 255; $g = ( $g + $m ) * 255; $b = ( $b + $m ) * 255; return [$r, $g, $b]; } print_r(HSL2RGB(55, 100, 100));

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.0170.00318.43
8.3.50.0100.00921.21
8.3.40.0110.00418.93
8.3.30.0100.00319.08
8.3.20.0070.00020.23
8.3.10.0140.00423.60
8.3.00.0040.00419.26
8.2.180.0060.01517.00
8.2.170.0040.01122.96
8.2.160.0030.01020.34
8.2.150.0040.00424.18
8.2.140.0090.00924.66
8.2.130.0080.00026.16
8.2.120.0120.00321.10
8.2.110.0040.00420.52
8.2.100.0060.00617.97
8.2.90.0100.00018.28
8.2.80.0050.00517.97
8.2.70.0100.00017.75
8.2.60.0060.00317.92
8.2.50.0070.00718.07
8.2.40.0040.00420.07
8.2.30.0030.00618.07
8.2.20.0050.00217.71
8.2.10.0040.00418.32
8.2.00.0040.00417.89
8.1.280.0150.00025.92
8.1.270.0080.01122.18
8.1.260.0040.01126.35
8.1.250.0100.00328.09
8.1.240.0000.00822.25
8.1.230.0090.00320.85
8.1.220.0030.00617.74
8.1.210.0080.00019.10
8.1.200.0030.00717.38
8.1.190.0040.00417.34
8.1.180.0040.00418.10
8.1.170.0000.00818.79
8.1.160.0000.00722.14
8.1.150.0000.00719.02
8.1.140.0040.00417.54
8.1.130.0000.00717.93
8.1.120.0040.00417.53
8.1.110.0030.00317.58
8.1.100.0000.00717.56
8.1.90.0000.00717.54
8.1.80.0030.00317.48
8.1.70.0070.00017.55
8.1.60.0060.00317.56
8.1.50.0000.00817.49
8.1.40.0040.00417.65
8.1.30.0040.00417.67
8.1.20.0000.00817.76
8.1.10.0050.00217.46
8.1.00.0040.00417.41
8.0.300.0040.00420.19
8.0.290.0040.00416.75
8.0.280.0070.00018.56
8.0.270.0030.00517.29
8.0.260.0030.00317.36
8.0.250.0030.00317.07
8.0.240.0040.00417.02
8.0.230.0000.00717.00
8.0.220.0000.00716.88
8.0.210.0070.00016.85
8.0.200.0030.00317.06
8.0.190.0050.00216.99
8.0.180.0000.00916.96
8.0.170.0040.00416.99
8.0.160.0000.00717.09
8.0.150.0040.00416.79
8.0.140.0040.00416.78
8.0.130.0060.00013.40
8.0.120.0040.00416.83
8.0.110.0080.00016.82
8.0.100.0050.00216.98
8.0.90.0080.00016.81
8.0.80.0060.01516.90
8.0.70.0070.00016.99
8.0.60.0000.00716.85
8.0.50.0040.00416.76
8.0.30.0130.01017.16
8.0.20.0090.01317.40
8.0.10.0000.00817.07
8.0.00.0120.00916.94
7.4.330.0020.00215.02
7.4.320.0030.00316.45
7.4.300.0030.00316.48
7.4.290.0030.00316.57
7.4.280.0000.00716.71
7.4.270.0070.00016.61
7.4.260.0000.00716.58
7.4.250.0000.00816.57
7.4.240.0070.00016.70
7.4.230.0000.00716.74
7.4.220.0160.00616.64
7.4.210.0110.00416.53
7.4.200.0000.00716.77
7.4.160.0180.00316.48
7.4.150.0120.00617.40
7.4.140.0050.01517.86
7.4.130.0100.00816.68
7.4.120.0050.01116.58
7.4.110.0070.01116.51
7.4.100.0120.00616.70
7.4.90.0160.00316.64
7.4.80.0090.00819.39
7.4.70.0140.00316.51
7.4.60.0040.01316.66
7.4.50.0000.00616.48
7.4.40.0120.00616.70
7.4.30.0090.00916.65
7.4.00.0040.01015.07
7.3.330.0050.00013.37
7.3.320.0000.00613.31
7.3.310.0000.00716.41
7.3.300.0070.00016.31
7.3.290.0080.00716.45
7.3.280.0100.00916.47
7.3.270.0140.01017.40
7.3.260.0030.01416.37
7.3.250.0070.01016.60
7.3.240.0130.00716.78
7.3.230.0060.01116.64
7.3.210.0080.00816.75
7.3.200.0130.00319.39
7.3.190.0060.01116.73
7.3.180.0060.00916.41
7.3.170.0030.01616.36
7.3.160.0130.00916.52
7.3.120.0070.01114.95
7.3.110.0050.01214.61
7.3.100.0070.01014.84
7.3.90.0030.01014.71
7.3.80.0060.01014.80
7.3.70.0030.01014.88
7.3.60.0070.00715.05
7.3.50.0070.00714.70
7.3.40.0000.01214.70
7.3.30.0080.00614.70
7.3.20.0120.00316.76
7.3.10.0030.00616.76
7.3.00.0070.00716.69
7.2.330.0140.00716.82
7.2.320.0090.00916.53
7.2.310.0040.01716.49
7.2.300.0080.01516.63
7.2.290.0110.01516.79
7.2.250.0070.01015.07
7.2.240.0040.01514.96
7.2.230.0110.00715.23
7.2.220.0030.00715.29
7.2.210.0070.00715.17
7.2.200.0080.00315.12
7.2.190.0030.01015.16
7.2.180.0000.01614.92
7.2.170.0060.00614.97
7.2.60.0070.00716.91
7.2.50.0200.00617.00
7.1.330.0070.01015.93
7.1.320.0030.00915.72
7.1.310.0090.00616.02
7.1.300.0090.00616.01
7.1.290.0030.00615.80
7.1.280.0080.00315.81
7.1.270.0060.00815.66
7.1.260.0000.01215.95
7.1.200.0040.01115.96
7.1.70.0100.00317.29
7.1.60.0070.01619.32
7.1.50.0110.01116.82
7.1.00.0030.07722.70
7.0.200.0030.00516.84
7.0.140.0000.07721.93
7.0.60.0030.09020.15
7.0.50.0030.09318.02
7.0.40.0100.09019.97
7.0.30.0570.07020.13
7.0.20.0200.06020.32
7.0.10.2000.05020.29
7.0.00.0100.04720.28
5.6.280.0030.07321.20
5.6.210.0130.07320.81
5.6.200.0100.04718.25
5.6.190.0170.03720.75
5.6.180.0270.03320.53
5.6.170.0270.03720.54
5.6.160.0000.05020.62
5.6.150.0030.05718.34
5.6.140.0100.04018.29
5.6.130.0130.07718.36
5.6.120.0070.04721.18
5.6.110.0070.07021.16
5.6.100.0170.06321.21
5.6.90.0170.07721.17
5.6.80.0130.07320.61
5.6.70.4470.03720.50
5.5.350.0100.08020.44
5.5.340.0100.07718.04
5.5.330.0130.04320.27
5.5.320.0100.05720.32
5.5.310.0270.04320.45
5.5.300.0070.03718.06
5.5.290.0070.08018.08
5.5.280.0030.08720.82
5.5.270.0070.07320.83
5.5.260.0000.08321.12
5.5.250.0030.09020.63
5.5.240.0370.06020.26
5.4.450.0830.05319.47
5.4.440.0970.06719.61
5.4.430.0900.05319.47
5.4.420.0730.05319.47
5.4.410.0800.05319.35
5.4.400.0800.05019.16
5.4.390.1270.05719.28
5.4.380.0930.07019.12
5.4.370.0200.04718.98
5.4.360.1030.04319.30
5.4.350.0400.05019.35
5.4.340.0060.03412.02
5.4.320.0050.03712.52
5.4.310.0060.03812.51
5.4.300.0090.03412.51
5.4.290.0070.03712.51
5.4.280.0050.03712.41
5.4.270.0060.03712.40
5.4.260.0070.03712.40
5.4.250.0060.03812.40
5.4.240.0080.03412.41
5.4.230.0070.03612.39
5.4.220.0030.03812.40
5.4.210.0080.03412.40
5.4.200.0070.03712.40
5.4.190.0040.03912.39
5.4.180.0080.03412.39
5.4.170.0030.04012.40
5.4.160.0060.03612.40
5.4.150.0060.03712.39
5.4.140.0070.03612.08
5.4.130.0070.03412.07
5.4.120.0060.03512.03
5.4.110.0120.03512.02
5.4.100.0060.03812.02
5.4.90.0040.03812.02
5.4.80.0110.04312.02
5.4.70.0090.03212.02
5.4.60.0050.03512.02
5.4.50.0070.03412.02
5.4.40.0090.03212.00
5.4.30.0050.03712.00
5.4.20.0090.03712.00
5.4.10.0080.03312.00
5.4.00.0020.04211.49
5.3.290.0060.03912.80
5.3.280.0060.03612.70
5.3.270.0090.04312.73
5.3.260.0080.03712.72
5.3.250.0090.03512.72
5.3.240.0070.04212.72
5.3.230.0060.03912.70
5.3.220.0040.04012.68
5.3.210.0070.04212.68
5.3.200.0080.04112.68
5.3.190.0090.04312.68
5.3.180.0070.04112.68
5.3.170.0070.03612.67
5.3.160.0070.03612.68
5.3.150.0060.03712.67
5.3.140.0070.03612.66
5.3.130.0060.03912.66
5.3.120.0050.03912.66
5.3.110.0100.03412.66
5.3.100.0050.04112.14
5.3.90.0070.03512.12
5.3.80.0050.03612.10
5.3.70.0060.03812.11
5.3.60.0060.03412.09
5.3.50.0050.03712.04
5.3.40.0050.03712.04
5.3.30.0030.03712.00
5.3.20.0080.03411.78
5.3.10.0080.03311.74
5.3.00.0040.03911.73
5.2.170.0030.0329.23
5.2.160.0040.0379.23
5.2.150.0050.0309.23
5.2.140.0050.0299.23
5.2.130.0030.0329.19
5.2.120.0050.0309.19
5.2.110.0040.0309.20
5.2.100.0040.0329.19
5.2.90.0050.0289.20
5.2.80.0040.0319.19
5.2.70.0000.0369.19
5.2.60.0080.0279.14
5.2.50.0040.0319.11
5.2.40.0050.0299.09
5.2.30.0040.0329.07
5.2.20.0050.0309.05
5.2.10.0040.0298.96
5.2.00.0030.0328.82
5.1.60.0050.0318.10
5.1.50.0020.0288.10
5.1.40.0010.0278.08
5.1.30.0070.0238.43
5.1.20.0060.0258.45
5.1.10.0060.0248.18
5.1.00.0030.0278.18
5.0.50.0030.0216.67
5.0.40.0010.0216.53
5.0.30.0060.0336.34
5.0.20.0020.0206.30
5.0.10.0040.0196.29
5.0.00.0050.0306.27
4.4.90.0050.0204.78
4.4.80.0020.0154.75
4.4.70.0020.0164.76
4.4.60.0020.0164.76
4.4.50.0020.0164.77
4.4.40.0060.0224.71
4.4.30.0040.0144.76
4.4.20.0030.0154.84
4.4.10.0020.0164.84
4.4.00.0020.0284.76
4.3.110.0030.0174.67
4.3.100.0040.0144.66
4.3.90.0040.0144.63
4.3.80.0030.0244.59
4.3.70.0030.0144.63
4.3.60.0020.0154.62
4.3.50.0040.0144.63
4.3.40.0030.0244.54
4.3.30.0000.0183.32
4.3.20.0020.0163.30
4.3.10.0010.0173.27
4.3.00.0330.0177.11

preferences:
47.04 ms | 401 KiB | 5 Q