3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getContrastYIQ($hexcolor){ $r = hexdec(substr($hexcolor,0,2)); $g = hexdec(substr($hexcolor,2,2)); $b = hexdec(substr($hexcolor,4,2)); $yiq = (($r*299)+($g*587)+($b*114))/1000; return ($yiq >= 128) ? 'black' : 'white'; } $color = getContrastYIQ(); if(empty($color)) { echo "Empty"; }

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.01016.63
8.3.50.0250.00217.22
8.3.40.0150.00018.81
8.3.30.0110.00318.57
8.3.20.0080.00018.91
8.3.10.0030.00620.53
8.3.00.0050.00319.38
8.2.180.0140.00416.62
8.2.170.0110.00722.96
8.2.160.0130.00319.11
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0040.00420.87
8.2.110.0060.00619.27
8.2.100.0090.00317.91
8.2.90.0040.00419.08
8.2.80.0040.00417.97
8.2.70.0000.01017.63
8.2.60.0000.00818.04
8.2.50.0040.00418.07
8.2.40.0000.00818.03
8.2.30.0000.00718.07
8.2.20.0090.00017.56
8.2.10.0040.00417.74
8.2.00.0040.00417.77
8.1.280.0100.01025.92
8.1.270.0050.00324.66
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0100.00021.24
8.1.230.0080.00417.42
8.1.220.0040.00417.74
8.1.210.0050.00318.77
8.1.200.0000.00817.23
8.1.190.0040.00417.23
8.1.180.0000.00818.10
8.1.170.0050.00518.76
8.1.160.0070.00018.77
8.1.150.0040.00418.55
8.1.140.0050.00317.40
8.1.130.0000.00717.73
8.1.120.0000.00817.42
8.1.110.0080.00017.31
8.1.100.0030.00317.32
8.1.90.0030.00317.27
8.1.80.0000.00717.36
8.1.70.0030.00317.36
8.1.60.0000.00817.56
8.1.50.0000.00717.46
8.1.40.0000.00717.47
8.1.30.0000.00817.61
8.1.20.0040.00417.61
8.1.10.0040.00417.52
8.1.00.0090.00017.41
8.0.300.0040.00418.77
8.0.290.0040.00416.75
8.0.280.0000.00718.42
8.0.270.0040.00417.14
8.0.260.0060.00018.42
8.0.250.0060.00316.92
8.0.240.0030.00516.93
8.0.230.0020.00516.94
8.0.220.0030.00316.93
8.0.210.0030.00316.93
8.0.200.0000.00716.97
8.0.190.0000.00716.88
8.0.180.0020.00516.98
8.0.170.0030.00616.78
8.0.160.0040.00416.98
8.0.150.0000.00716.86
8.0.140.0030.00616.77
8.0.130.0000.00513.31
8.0.120.0070.00016.78
8.0.110.0040.00416.78
8.0.100.0040.00416.85
8.0.90.0000.00716.79
8.0.80.0060.00916.87
8.0.70.0040.00416.98
8.0.60.0040.00416.74
8.0.50.0080.00016.77
8.0.30.0090.00917.09
8.0.20.0130.00517.16
8.0.10.0040.00416.92
8.0.00.0100.01116.63
7.4.330.0000.00512.83
7.4.320.0070.00016.46
7.4.300.0000.00716.57
7.4.290.0000.00816.52
7.4.280.0050.00316.43
7.4.270.0070.00016.55
7.4.260.0000.00513.20
7.4.250.0040.00416.45
7.4.240.0030.00516.58
7.4.230.0000.00716.40
7.4.220.0130.00716.38
7.4.210.0070.00816.56
7.4.200.0000.00716.36
7.4.190.0070.00016.65
7.4.160.0090.00916.32
7.4.150.0090.00916.65
7.4.140.0090.00716.42
7.4.130.0160.00316.51
7.4.120.0090.00816.39
7.4.110.0070.01116.50
7.4.100.0030.01416.39
7.4.90.0030.02016.33
7.4.80.0100.00619.39
7.4.70.0140.00716.47
7.4.60.0110.00416.55
7.4.50.0120.00016.38
7.4.40.0090.00916.52
7.4.30.0130.00316.47
7.4.00.0000.01714.76
7.3.330.0070.00013.32
7.3.320.0030.00313.13
7.3.310.0070.00016.38
7.3.300.0000.00616.32
7.3.290.0060.01016.30
7.3.280.0080.01016.24
7.3.270.0060.01216.42
7.3.260.0200.00316.34
7.3.250.0110.00916.39
7.3.240.0030.01816.33
7.3.230.0140.01016.65
7.3.210.0070.01016.33
7.3.200.0060.01016.35
7.3.190.0100.01016.31
7.3.180.0100.00616.33
7.3.170.0080.00816.47
7.3.160.0150.00616.27
7.3.120.0090.00314.82
7.2.330.0140.00316.60
7.2.320.0030.01916.34
7.2.310.0060.01216.54
7.2.300.0080.00916.61
7.2.290.0030.01316.51
7.2.60.0070.00716.91
7.2.00.0070.00719.46
7.1.200.0030.00715.43
7.1.100.0070.01017.93
7.1.70.0070.00317.14
7.1.60.0130.00719.40
7.1.50.0030.01716.62
7.1.00.0070.06722.41
7.0.200.0040.00416.81
7.0.140.0030.07321.95
7.0.120.0030.03322.15
7.0.60.0000.07720.02
7.0.50.0030.08317.84
7.0.40.0100.03719.97
7.0.30.0230.08320.07
7.0.20.0300.07720.08
7.0.10.0030.08320.15
7.0.00.0000.05020.33
5.6.280.0000.07321.07
5.6.210.0130.04020.45
5.6.200.0030.04018.13
5.6.190.0130.06020.52
5.6.180.0470.07720.63
5.6.170.0100.05320.39
5.6.160.0070.07020.46
5.6.150.0100.06018.12
5.6.140.0030.04318.25
5.6.130.0070.08318.28
5.6.120.0100.03721.00
5.6.110.0230.06321.02
5.6.100.0030.04021.09
5.6.90.0130.06720.96
5.6.80.0170.07320.42
5.5.350.0200.07720.35
5.5.340.0130.07317.92
5.5.330.0070.04020.30
5.5.320.0300.05320.47
5.5.310.0130.04720.30
5.5.300.0130.07017.97
5.5.290.0170.06717.92
5.5.280.0070.08020.97
5.5.270.0030.04720.82
5.5.260.0130.07020.94
5.5.250.0100.05720.69
5.5.240.0000.08320.19
5.4.450.0100.07019.18
5.4.440.0100.08319.41
5.4.430.0070.04719.56
5.4.420.0070.06319.17
5.4.410.0030.04719.32
5.4.400.0070.04019.15
5.4.390.0130.05719.15
5.4.380.0030.08019.24
5.4.370.0070.03719.24
5.4.360.0100.04319.16
5.4.350.0100.07018.92
5.4.340.0130.05019.14
5.4.320.0070.08019.12
5.4.310.0030.08719.20
5.4.300.0070.05718.84
5.4.290.0000.04319.24
5.4.280.0070.07719.08
5.4.270.0100.04019.14
5.4.260.0130.04319.12
5.4.250.0030.08019.00
5.4.240.0070.08019.23
5.4.230.0070.03718.84
5.4.220.0100.07319.24
5.4.210.0030.05019.08
5.4.200.0030.04018.86
5.4.190.0100.05018.84
5.4.180.0030.04018.84
5.4.170.0000.04718.84
5.4.160.0130.07319.12
5.4.150.0100.07019.15
5.4.140.0100.04016.50
5.4.130.0070.07016.43
5.4.120.0170.06716.34
5.4.110.0100.06016.30
5.4.100.0170.04316.41
5.4.90.0030.04016.39
5.4.80.0030.06316.40
5.4.70.0130.06716.45
5.4.60.0000.06016.34
5.4.50.0030.03716.40
5.4.40.0000.06016.64
5.4.30.0030.03716.46
5.4.20.0100.05716.40
5.4.10.0100.06316.39
5.4.00.0070.04015.88
5.3.290.0100.03314.72
5.3.280.0070.03314.62
5.3.270.0070.03714.66
5.3.260.0100.07714.63
5.3.250.0070.06314.60
5.3.240.0100.07014.66
5.3.230.0070.08314.61
5.3.220.0130.06014.59
5.3.210.0070.05314.59
5.3.200.0000.08014.61
5.3.190.0000.04714.61
5.3.180.0030.04314.58
5.3.170.0030.07714.62
5.3.160.0070.05314.73
5.3.150.0030.06714.60
5.3.140.0130.06014.58
5.3.130.0000.05014.60
5.3.120.0000.04314.58
5.3.110.0030.04014.54
5.3.100.0100.08013.92
5.3.90.0030.08014.17
5.3.80.0100.06014.04
5.3.70.0070.06014.06
5.3.60.0030.05714.06
5.3.50.0070.04013.86
5.3.40.0100.06714.00
5.3.30.0030.04713.91
5.3.20.0070.06713.70
5.3.10.0030.05013.66
5.3.00.0100.06713.63
5.2.170.0100.06011.20
5.2.160.0030.04311.19
5.2.150.0070.04711.14
5.2.140.0030.04311.13
5.2.130.0030.05311.07
5.2.120.0170.05711.25
5.2.110.0100.03011.15
5.2.100.0130.04711.17
5.2.90.0070.04711.11
5.2.80.0030.04311.16
5.2.70.0070.06011.16
5.2.60.0030.05311.04
5.2.50.0070.06010.94
5.2.40.0030.05010.96
5.2.30.0030.05010.98
5.2.20.0030.06711.01
5.2.10.0000.06310.82
5.2.00.0100.05310.82
5.1.60.0030.05710.82
5.1.50.0100.05010.82
5.1.40.0100.04310.82
5.1.30.0070.02710.82
5.1.20.0000.04310.82
5.1.10.0070.04710.82
5.1.00.0100.05010.82
5.0.50.0030.03710.82
5.0.40.0030.03310.82
5.0.30.0070.06310.82
5.0.20.0070.04010.82
5.0.10.0100.03010.82
5.0.00.0030.03710.82
4.4.90.0030.02710.82
4.4.80.0070.03010.82
4.4.70.0030.03310.82
4.4.60.0100.02710.82
4.4.50.0000.02010.82
4.4.40.0030.02710.82
4.4.30.0000.03710.82
4.4.20.0000.04010.82
4.4.10.0030.03310.82
4.4.00.0030.05310.82
4.3.110.0030.02310.82
4.3.100.0000.02010.82
4.3.90.0030.03710.82
4.3.80.0000.06010.82
4.3.70.0070.02710.82
4.3.60.0000.03710.82
4.3.50.0030.03710.82
4.3.40.0000.03010.82
4.3.30.0000.03010.82
4.3.20.0030.03310.82
4.3.10.0000.03710.82
4.3.00.0100.01710.82

preferences:
42.14 ms | 401 KiB | 5 Q