3v4l.org

run code in 300+ PHP versions simultaneously
<?php // RYB color to RGB color function RYB2RGB($iRed, $iYellow, $iBlue){ // Save the RYB $original_ryb = [$iRed, $iYellow, $iBlue]; // Remove the whiteness from the color. $iWhite = min($iRed, $iYellow, $iBlue); $iRed -= $iWhite; $iYellow -= $iWhite; $iBlue -= $iWhite; $iMaxYellow = max($iRed, $iYellow, $iBlue); // Get the green out of the yellow and blue $iGreen = min($iYellow, $iBlue); $iYellow -= $iGreen; $iBlue -= $iGreen; if ($iBlue > 0 && $iGreen > 0) { $iBlue *= 2.0; $iGreen *= 2.0; } // Redistribute the remaining yellow. $iRed += $iYellow; $iGreen += $iYellow; // Normalize to values. $iMaxGreen = max($iRed, $iGreen, $iBlue); if ($iMaxGreen > 0) { $iN = $iMaxYellow / $iMaxGreen; $iRed *= $iN; $iGreen *= $iN; $iBlue *= $iN; } // Add the white back $in. $iRed += $iWhite; $iGreen += $iWhite; $iBlue += $iWhite; // Save the RGB $RGB = [floor($iRed), floor($iGreen), floor($iBlue)]; return $RGB; } $R = 98; $y = 152; $b = 223; var_dump( RYB2RGB( $R, $y, $b ) );

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.5.10.0140.00716.80
8.5.00.0110.01019.90
8.4.160.0130.00921.39
8.4.150.0020.00014.05
8.4.140.0110.01017.82
8.4.130.0050.00517.54
8.4.120.0130.00720.57
8.4.110.0110.01022.54
8.4.100.0110.01018.80
8.4.90.0130.00718.86
8.4.80.0110.00918.94
8.4.70.0150.00617.93
8.4.60.0040.00519.02
8.4.50.0100.00918.76
8.4.40.0030.01319.34
8.4.30.0160.00318.85
8.4.20.0040.01118.85
8.4.10.0000.01017.57
8.3.290.0100.01020.82
8.3.280.0180.00718.49
8.3.270.0110.00916.87
8.3.260.0130.00616.71
8.3.250.0080.00919.14
8.3.240.0060.00819.09
8.3.230.0090.00716.68
8.3.220.0080.00618.85
8.3.210.0060.00216.88
8.3.200.0030.00616.59
8.3.190.0100.00817.23
8.3.180.0120.00816.60
8.3.170.0120.00619.01
8.3.160.0140.00417.17
8.3.150.0000.00917.25
8.3.140.0050.00318.65
8.3.130.0050.00316.76
8.3.120.0120.00618.90
8.3.110.0030.00716.64
8.3.100.0000.00916.62
8.3.90.0030.00626.77
8.3.80.0030.00616.75
8.3.70.0140.00716.63
8.3.60.0090.00616.63
8.3.50.0070.00918.21
8.3.40.0150.00018.75
8.3.30.0040.01118.82
8.3.20.0040.00422.03
8.3.10.0040.00421.89
8.3.00.0080.00022.58
8.2.300.0090.01122.34
8.2.290.0120.00720.33
8.2.280.0100.01018.36
8.2.270.0190.00017.28
8.2.260.0140.00316.64
8.2.250.0040.00418.50
8.2.240.0080.00017.29
8.2.230.0160.00320.94
8.2.220.0000.00724.06
8.2.210.0190.00026.77
8.2.200.0040.00418.39
8.2.190.0070.00716.63
8.2.180.0040.01125.92
8.2.170.0110.01118.95
8.2.160.0140.00021.01
8.2.150.0090.00024.18
8.2.140.0080.00024.66
8.2.130.0000.00726.16
8.2.120.0000.00726.16
8.2.110.0060.01020.66
8.2.100.0110.00017.97
8.2.90.0070.00020.55
8.2.80.0000.00917.97
8.2.70.0000.00818.02
8.2.60.0000.00918.34
8.2.50.0080.00018.10
8.2.40.0000.00819.34
8.2.30.0040.00419.29
8.2.20.0000.00718.24
8.2.10.0000.00719.39
8.2.00.0080.00019.30
8.1.340.0140.00617.58
8.1.330.0120.00621.87
8.1.320.0110.00816.11
8.1.310.0080.00016.70
8.1.300.0150.00318.02
8.1.290.0040.00430.84
8.1.280.0090.00625.92
8.1.270.0080.00024.66
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0060.00322.16
8.1.230.0000.01122.07
8.1.220.0030.00617.78
8.1.210.0000.00818.86
8.1.200.0050.00317.36
8.1.190.0030.00517.13
8.1.180.0030.00818.10
8.1.170.0050.00318.70
8.1.160.0000.00718.95
8.1.150.0040.00418.91
8.1.140.0000.00720.87
8.1.130.0030.00520.07
8.1.120.0070.00017.41
8.1.110.0040.00417.37
8.1.100.0070.00017.52
8.1.90.0040.00417.40
8.1.80.0030.00617.49
8.1.70.0000.00817.51
8.1.60.0030.00617.63
8.1.50.0040.00417.48
8.1.40.0040.00417.50
8.1.30.0040.00417.63
8.1.20.0000.00817.68
8.1.10.0030.00517.48
8.1.00.0000.00817.55
8.0.300.0000.00720.03
8.0.290.0070.00016.75
8.0.280.0030.00318.52
8.0.270.0090.00018.71
8.0.260.0030.00320.18
8.0.250.0030.00316.99
8.0.240.0000.00717.04
8.0.230.0050.00317.07
8.0.220.0030.00316.89
8.0.210.0000.00717.02
8.0.200.0040.00416.93
8.0.190.0030.00617.08
8.0.180.0040.00416.89
8.0.170.0090.00016.98
8.0.160.0040.00416.99
8.0.150.0040.00416.91
8.0.140.0040.00416.82
8.0.130.0000.00613.39
8.0.120.0040.00416.95
8.0.110.0040.00416.86
8.0.100.0040.00416.87
8.0.90.0030.00616.86
8.0.80.0050.01016.93
8.0.70.0040.00416.75
8.0.60.0070.00016.79
8.0.50.0040.00417.07
8.0.30.0120.00617.04
8.0.20.0100.00917.04
8.0.10.0060.00917.04
8.0.00.0060.01017.05
7.4.330.0000.00515.55
7.4.320.0030.00316.55
7.4.300.0030.00316.62
7.4.290.0050.00316.54
7.4.280.0040.00416.55
7.4.270.0070.00016.57
7.4.260.0050.00013.30
7.4.250.0020.00516.64
7.4.240.0050.00316.59
7.4.230.0000.00716.75
7.4.220.0000.00716.50
7.4.210.0100.00816.61
7.4.200.0030.00316.77
7.4.160.0090.00616.61
7.4.150.0000.01416.68
7.4.140.0100.00717.20
7.4.130.0080.00816.59
7.4.120.0070.00816.51
7.4.110.0090.00616.57
7.4.100.0100.00816.49
7.4.90.0090.01216.55
7.4.80.0090.01317.91
7.4.70.0160.01116.57
7.4.60.0090.00716.48
7.4.50.0040.01216.43
7.4.40.0090.00916.43
7.4.30.0080.00616.48
7.4.20.0100.00316.57
7.4.10.0080.00715.79
7.4.00.0130.00615.65
7.3.330.0000.00716.29
7.3.320.0030.00313.45
7.3.310.0040.00416.24
7.3.300.0030.00316.39
7.3.290.0070.00016.46
7.3.280.0070.01316.46
7.3.270.0100.00316.36
7.3.260.0140.00616.59
7.3.250.0040.01216.41
7.3.240.0070.00916.54
7.3.230.0090.00816.47
7.3.220.0060.00916.34
7.3.210.0090.00816.46
7.3.200.0050.01416.42
7.3.190.0100.00616.37
7.3.180.0060.01016.38
7.3.170.0090.01116.39
7.3.160.0070.00816.34
7.3.150.0060.01016.36
7.3.140.0090.00616.36
7.3.130.0100.00515.68
7.3.120.0090.00515.50
7.3.110.0060.01015.46
7.3.100.0080.00515.62
7.3.90.0060.00715.32
7.3.80.0060.00915.38
7.3.70.0070.00615.37
7.3.60.0100.00615.42
7.3.50.0090.00715.45
7.3.40.0030.01115.33
7.3.30.0060.00815.38
7.3.20.0050.01015.99
7.3.10.0060.00916.03
7.3.00.0050.01015.91
7.2.340.0040.01116.46
7.2.330.0140.01016.72
7.2.320.0170.00616.60
7.2.310.0140.00816.71
7.2.300.0130.00816.58
7.2.290.0140.01016.59
7.2.280.0100.01516.39
7.2.270.0160.01316.43
7.2.260.0130.00915.68
7.2.250.0260.01015.89
7.2.240.0080.01315.64
7.2.230.0150.00715.88
7.2.220.0090.00815.60
7.2.210.0080.01015.54
7.2.200.0110.00715.55
7.2.190.0120.00515.60
7.2.180.0200.00915.61
7.2.170.0130.00515.49
7.2.160.0090.00915.52
7.2.150.0130.00716.25
7.2.140.0200.01016.27
7.2.130.0130.00716.31
7.2.120.0110.01016.37
7.2.110.0130.00716.35
7.2.100.0080.01016.24
7.2.90.0120.00916.17
7.2.80.0120.00716.18
7.2.70.0130.00716.37
7.2.60.0080.01216.18
7.2.50.0110.00916.21
7.2.40.0110.01016.32
7.2.30.0070.01216.33
7.2.20.0120.00916.19
7.2.10.0120.00616.17
7.2.00.0090.01116.21
7.1.330.0100.00915.71
7.1.320.0100.00515.07
7.1.310.0080.00715.01
7.1.300.0090.00815.15
7.1.290.0090.00915.03
7.1.280.0100.00715.13
7.1.270.0110.00715.15
7.1.260.0080.01015.10
7.1.250.0110.00415.05
7.1.240.0300.00615.69
7.1.230.0160.00515.66
7.1.220.0090.01115.64
7.1.210.0130.00715.66
7.1.200.0100.00915.74
7.1.190.0160.00615.73
7.1.180.0140.00315.64
7.1.170.0100.01015.77
7.1.160.0120.00715.75
7.1.150.0110.01015.71
7.1.140.0100.01015.51
7.1.130.0100.01115.65
7.1.120.0140.00715.67
7.1.110.0270.00515.69
7.1.100.0130.00715.79
7.1.90.0120.00715.68
7.1.80.0160.00515.77
7.1.70.0120.01015.63
7.1.60.0140.00615.70
7.1.50.0110.00715.80
7.1.40.0080.01115.76
7.1.30.0100.00815.73
7.1.20.0170.00215.72
7.1.10.0540.00815.56
7.1.00.0110.00815.74

preferences:
34.38 ms | 403 KiB | 5 Q