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(50, 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.0070.01418.56
8.3.50.0150.00721.22
8.3.40.0040.01118.59
8.3.30.0040.01119.17
8.3.20.0110.00720.41
8.3.10.0110.00723.69
8.3.00.0050.00319.38
8.2.180.0000.01516.63
8.2.170.0040.01122.96
8.2.160.0040.01120.57
8.2.150.0110.00724.18
8.2.140.0060.00324.66
8.2.130.0040.00426.16
8.2.120.0050.00321.09
8.2.110.0060.00320.47
8.2.100.0040.00819.70
8.2.90.0030.00618.28
8.2.80.0060.00317.97
8.2.70.0030.00517.75
8.2.60.0040.00717.93
8.2.50.0100.00318.07
8.2.40.0040.00420.07
8.2.30.0000.00818.22
8.2.20.0040.00417.65
8.2.10.0000.00718.32
8.2.00.0000.00817.74
8.1.280.0120.00325.92
8.1.270.0060.00321.96
8.1.260.0110.00426.35
8.1.250.0090.00928.09
8.1.240.0040.00422.14
8.1.230.0120.00020.97
8.1.220.0070.00317.89
8.1.210.0000.00818.96
8.1.200.0030.00617.35
8.1.190.0040.00417.35
8.1.180.0080.00018.10
8.1.170.0040.00418.45
8.1.160.0000.00722.02
8.1.150.0050.00218.94
8.1.140.0000.00717.46
8.1.130.0070.00017.96
8.1.120.0000.00717.45
8.1.110.0000.00817.50
8.1.100.0040.00417.51
8.1.90.0030.00517.60
8.1.80.0000.00817.45
8.1.70.0050.00217.50
8.1.60.0060.00317.57
8.1.50.0040.00417.50
8.1.40.0000.00817.66
8.1.30.0030.00517.71
8.1.20.0030.00517.79
8.1.10.0040.00417.62
8.1.00.0000.00817.55
8.0.300.0000.00720.16
8.0.290.0040.00416.63
8.0.280.0070.00018.46
8.0.270.0030.00517.27
8.0.260.0060.00017.30
8.0.250.0070.00016.98
8.0.240.0000.00817.07
8.0.230.0030.00317.03
8.0.220.0070.00016.89
8.0.210.0040.00416.98
8.0.200.0000.00617.00
8.0.190.0030.00316.93
8.0.180.0000.01116.84
8.0.170.0000.00917.00
8.0.160.0070.00016.92
8.0.150.0070.00016.86
8.0.140.0000.00816.87
8.0.130.0030.00313.37
8.0.120.0040.00416.93
8.0.110.0000.00716.88
8.0.100.0040.00417.04
8.0.90.0070.00017.04
8.0.80.0130.01016.94
8.0.70.0040.00416.93
8.0.60.0000.00716.93
8.0.50.0050.00217.00
8.0.30.0100.01217.09
8.0.20.0120.01117.40
8.0.10.0070.00016.97
8.0.00.0070.01316.72
7.4.330.0000.00515.02
7.4.320.0050.00216.59
7.4.300.0070.00016.70
7.4.290.0030.00316.60
7.4.280.0030.00316.70
7.4.270.0000.00716.51
7.4.260.0000.00716.44
7.4.250.0030.00316.56
7.4.240.0030.00316.58
7.4.230.0030.00316.61
7.4.220.0120.00616.63
7.4.210.0040.01016.63
7.4.200.0030.00316.78
7.4.160.0060.01016.54
7.4.150.0160.00317.40
7.4.140.0090.01117.86
7.4.130.0130.00716.73
7.4.120.0140.00316.54
7.4.110.0110.00616.82
7.4.100.0080.01016.76
7.4.90.0170.00016.53
7.4.80.0080.00819.39
7.4.70.0030.01316.61
7.4.60.0070.01016.59
7.4.50.0080.00016.14
7.4.40.0030.01516.70
7.4.30.0030.01316.46
7.4.00.0000.01214.82
7.3.330.0050.00013.40
7.3.320.0000.00713.31
7.3.310.0040.00316.26
7.3.300.0040.00416.36
7.3.290.0050.00916.38
7.3.280.0120.00616.42
7.3.270.0120.01217.40
7.3.260.0070.01116.45
7.3.250.0160.00516.54
7.3.240.0130.00916.47
7.3.230.0110.00616.39
7.3.210.0130.00416.59
7.3.200.0120.00619.39
7.3.190.0130.00416.50
7.3.180.0080.00816.64
7.3.170.0040.01316.44
7.3.160.0060.00916.49
7.3.10.0060.00616.79
7.3.00.0060.00316.79
7.2.330.0090.00816.76
7.2.320.0110.00716.71
7.2.310.0090.01316.79
7.2.300.0110.01116.88
7.2.290.0200.00316.65
7.2.130.0060.01216.80
7.2.120.0040.01117.03
7.2.110.0030.00716.81
7.2.100.0030.01416.91
7.2.90.0040.01116.88
7.2.80.0000.01417.07
7.2.70.0030.00617.10
7.2.60.0060.00917.07
7.2.50.0040.00817.03
7.2.40.0030.00917.02
7.2.30.0040.00816.80
7.2.20.0150.00317.09
7.2.10.0130.00316.92
7.2.00.0130.00518.09
7.1.250.0000.01416.02
7.1.100.0090.00618.14
7.1.70.0000.01017.41
7.1.60.0030.02019.32
7.1.50.0080.01616.79
7.1.00.0000.07722.63
7.0.200.0000.00717.00
7.0.140.0030.07322.06
7.0.60.0100.08320.18
7.0.50.0130.03318.06
7.0.40.0000.07020.21
7.0.30.0500.05320.30
7.0.20.0270.04020.30
7.0.10.0100.09020.45
7.0.00.0070.09020.15
5.6.280.0030.07320.82
5.6.210.0130.08320.82
5.6.200.0130.08018.24
5.6.190.0200.07320.39
5.6.180.0100.04720.48
5.6.170.0300.07020.54
5.6.160.0000.06320.63
5.6.150.0030.04018.28
5.6.140.0100.08018.34
5.6.130.0100.06718.32
5.6.120.0070.08721.22
5.6.110.0100.04721.22
5.6.100.0100.09021.16
5.6.90.0230.07021.24
5.6.80.0030.04720.65
5.6.70.4570.04020.57
5.5.350.0330.07320.45
5.5.340.0030.05018.09
5.5.330.0070.03720.19
5.5.320.0370.07720.50
5.5.310.0170.04720.27
5.5.300.0100.07718.04
5.5.290.0130.07318.02
5.5.280.0100.08020.82
5.5.270.0030.05020.90
5.5.260.0070.06321.04
5.5.250.0030.04020.75
5.5.240.4170.04320.24
5.4.450.0800.06719.59
5.4.440.0870.07019.45
5.4.430.1000.06019.58
5.4.420.0830.05319.32
5.4.410.0870.05719.34
5.4.400.1070.06019.13
5.4.390.0870.06719.39
5.4.380.0870.04718.86
5.4.370.0670.06319.15
5.4.360.0800.05718.98
5.4.350.0800.05319.30
5.4.340.0080.03512.03
5.4.320.0050.04112.52
5.4.310.0040.04012.50
5.4.300.0060.03712.51
5.4.290.0060.04112.51
5.4.280.0060.03712.40
5.4.270.0030.04112.41
5.4.260.0050.03912.41
5.4.250.0060.03712.40
5.4.240.0090.03312.40
5.4.230.0080.03512.40
5.4.220.0070.03812.39
5.4.210.0020.04312.39
5.4.200.0100.03712.40
5.4.190.0110.03512.39
5.4.180.0050.03812.39
5.4.170.0060.03712.40
5.4.160.0080.03412.40
5.4.150.0070.03512.40
5.4.140.0050.03812.08
5.4.130.0050.03712.07
5.4.120.0030.03912.02
5.4.110.0080.03312.02
5.4.100.0040.03712.02
5.4.90.0060.03812.02
5.4.80.0060.03612.02
5.4.70.0020.03912.02
5.4.60.0050.03612.02
5.4.50.0060.03512.02
5.4.40.0090.03212.00
5.4.30.0100.03112.00
5.4.20.0030.03712.00
5.4.10.0030.03612.00
5.4.00.0040.03911.49
5.3.290.0060.03912.80
5.3.280.0050.04012.71
5.3.270.0080.03712.73
5.3.260.0040.04212.72
5.3.250.0060.03812.72
5.3.240.0040.04112.71
5.3.230.0060.03912.71
5.3.220.0070.03612.68
5.3.210.0050.03912.68
5.3.200.0070.03512.68
5.3.190.0080.03612.68
5.3.180.0050.03712.68
5.3.170.0080.03412.67
5.3.160.0060.04212.67
5.3.150.0080.04212.67
5.3.140.0070.04112.66
5.3.130.0050.04312.66
5.3.120.0090.03712.66
5.3.110.0050.04012.66
5.3.100.0070.03612.14
5.3.90.0060.03612.12
5.3.80.0020.04112.10
5.3.70.0090.03312.10
5.3.60.0050.03712.09
5.3.50.0040.03812.04
5.3.40.0060.03612.04
5.3.30.0030.03812.00
5.3.20.0040.03711.78
5.3.10.0060.03711.75
5.3.00.0040.03811.73
5.2.170.0050.0369.23
5.2.160.0020.0329.23
5.2.150.0070.0289.23
5.2.140.0050.0309.23
5.2.130.0070.0269.19
5.2.120.0060.0279.19
5.2.110.0060.0289.20
5.2.100.0040.0309.20
5.2.90.0050.0299.20
5.2.80.0040.0329.19
5.2.70.0050.0329.19
5.2.60.0060.0299.14
5.2.50.0070.0289.11
5.2.40.0040.0309.09
5.2.30.0060.0289.07
5.2.20.0050.0299.05
5.2.10.0050.0288.96
5.2.00.0040.0298.82
5.1.60.0060.0228.11
5.1.50.0030.0258.10
5.1.40.0060.0228.09
5.1.30.0080.0238.44
5.1.20.0050.0258.45
5.1.10.0020.0288.18
5.1.00.0030.0278.18
5.0.50.0020.0216.66
5.0.40.0020.0206.53
5.0.30.0080.0266.34
5.0.20.0030.0206.30
5.0.10.0040.0196.28
5.0.00.0030.0306.28
4.4.90.0030.0154.78
4.4.80.0010.0174.76
4.4.70.0010.0174.76
4.4.60.0020.0164.76
4.4.50.0060.0254.77
4.4.40.0040.0244.71
4.4.30.0020.0164.76
4.4.20.0040.0144.85
4.4.10.0040.0144.85
4.4.00.0040.0244.76
4.3.110.0020.0174.67
4.3.100.0020.0174.66
4.3.90.0020.0164.64
4.3.80.0040.0314.58
4.3.70.0040.0204.63
4.3.60.0040.0154.63
4.3.50.0020.0164.63
4.3.40.0030.0244.54
4.3.30.0020.0163.32
4.3.20.0020.0153.30
4.3.10.0030.0143.27
4.3.00.0170.0237.11

preferences:
46.14 ms | 401 KiB | 5 Q