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'; } echo getContrastYIQ();

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.0100.01018.43
8.3.50.0060.01122.11
8.3.40.0110.00718.79
8.3.30.0100.00320.25
8.3.20.0040.00418.69
8.3.10.0050.00320.92
8.3.00.0090.00019.61
8.2.180.0090.00916.75
8.2.170.0040.01122.96
8.2.160.0070.00720.52
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0070.00021.00
8.2.110.0000.00922.20
8.2.100.0030.00918.03
8.2.90.0080.00017.97
8.2.80.0040.00417.97
8.2.70.0030.00617.68
8.2.60.0000.00818.08
8.2.50.0060.00318.10
8.2.40.0030.00620.84
8.2.30.0040.00419.26
8.2.20.0040.00417.55
8.2.10.0050.00317.61
8.2.00.0030.00817.80
8.1.280.0070.01025.92
8.1.270.0000.00723.99
8.1.260.0000.00726.35
8.1.250.0030.00628.09
8.1.240.0030.00720.31
8.1.230.0030.00820.75
8.1.220.0030.00617.74
8.1.210.0030.00618.77
8.1.200.0030.00617.13
8.1.190.0050.00317.35
8.1.180.0000.00818.10
8.1.170.0030.00618.39
8.1.160.0000.00718.97
8.1.150.0050.00318.45
8.1.140.0000.00717.35
8.1.130.0000.00717.74
8.1.120.0030.00317.38
8.1.110.0000.00817.38
8.1.100.0000.00817.33
8.1.90.0000.00717.28
8.1.80.0040.00417.30
8.1.70.0040.00417.30
8.1.60.0040.00417.52
8.1.50.0000.00717.34
8.1.40.0030.00517.51
8.1.30.0070.00017.54
8.1.20.0040.00417.51
8.1.10.0040.00417.53
8.1.00.0040.00417.50
8.0.300.0080.00021.30
8.0.290.0080.00016.63
8.0.280.0050.00218.41
8.0.270.0100.00317.97
8.0.260.0030.00316.79
8.0.250.0050.00316.85
8.0.240.0050.00616.99
8.0.230.0040.00416.94
8.0.220.0030.00316.82
8.0.210.0040.00416.90
8.0.200.0030.00516.99
8.0.190.0080.00017.02
8.0.180.0040.00416.87
8.0.170.0060.00316.76
8.0.160.0030.00316.96
8.0.150.0030.00316.82
8.0.140.0070.00316.91
8.0.130.0000.00513.36
8.0.120.0000.00816.79
8.0.110.0040.00416.94
8.0.100.0080.00016.97
8.0.90.0000.00716.95
8.0.80.0070.01316.87
8.0.70.0000.00716.82
8.0.60.0040.00416.71
8.0.50.0000.00816.85
8.0.30.0110.01017.11
8.0.20.0140.01717.40
8.0.10.0080.00016.86
8.0.00.0020.01816.69
7.4.330.0000.00416.84
7.4.320.0030.00316.47
7.4.300.0030.00316.45
7.4.290.0070.00016.47
7.4.280.0070.00016.49
7.4.270.0000.00716.36
7.4.260.0030.00313.33
7.4.250.0000.01016.45
7.4.240.0030.00316.42
7.4.230.0000.00716.48
7.4.220.0190.00916.31
7.4.210.0120.00616.55
7.4.200.0040.00416.64
7.4.190.0040.00416.70
7.4.160.0160.00016.46
7.4.150.0090.00917.40
7.4.140.0110.00617.86
7.4.130.0080.00816.58
7.4.120.0110.00616.44
7.4.110.0110.00716.36
7.4.100.0130.00316.52
7.4.90.0150.00316.76
7.4.80.0100.00719.39
7.4.70.0180.00016.42
7.4.60.0170.00716.41
7.4.50.0040.00416.25
7.4.40.0090.00622.77
7.4.30.0060.01616.46
7.4.00.0110.00415.06
7.3.330.0000.00513.29
7.3.320.0030.00213.32
7.3.310.0070.00016.28
7.3.300.0000.00616.20
7.3.290.0030.01016.37
7.3.280.0080.00916.28
7.3.270.0060.01017.40
7.3.260.0140.00918.24
7.3.250.0030.01316.37
7.3.240.0090.00916.58
7.3.230.0160.00316.39
7.3.210.0130.00616.47
7.3.200.0100.01319.39
7.3.190.0060.01116.37
7.3.180.0100.01016.54
7.3.170.0080.00816.54
7.3.160.0050.01116.26
7.3.120.0110.00314.80
7.2.330.0100.01016.39
7.2.320.0070.01016.48
7.2.310.0250.02916.59
7.2.300.0120.00616.49
7.2.290.0040.01216.39
7.2.60.0070.00716.81
7.2.00.0000.01219.30
7.1.200.0070.00715.74
7.1.70.0030.00817.10
7.1.60.0000.01217.19
7.1.50.0070.00716.82
7.1.40.0090.00616.33
7.1.30.0100.00316.58
7.1.20.0000.01016.67
7.1.10.0050.00216.37
7.1.00.0000.00716.55
7.0.200.0040.00416.53
7.0.190.0080.00016.79
7.0.180.0000.01116.48
7.0.170.0110.00416.22
7.0.160.0000.00816.40
7.0.150.0000.00716.45
7.0.140.0030.00716.38
7.0.130.0030.00616.50
7.0.120.0080.00316.50
7.0.110.0050.00216.41
7.0.100.0000.00816.26
7.0.90.0050.00516.65
7.0.80.0000.01416.24
7.0.70.0040.00416.52
7.0.60.0000.00816.14
7.0.50.0070.00316.36
7.0.40.0000.00715.54
7.0.30.0040.00415.54
7.0.20.0070.00015.54
7.0.10.0090.00015.54
7.0.00.0050.00315.54
5.6.300.0100.03320.80
5.6.290.0030.04020.92
5.6.280.0030.04520.79
5.6.270.0030.04420.79
5.6.260.0000.04421.03
5.6.250.0030.04320.84
5.6.240.0000.04420.84
5.6.230.0000.04620.81
5.6.220.0070.04720.97
5.6.210.0070.04021.02
5.6.200.0070.03620.96
5.6.190.0000.04720.81
5.6.180.0100.07720.74
5.6.170.0030.04920.77
5.6.160.0100.04220.96
5.6.150.0070.04621.03
5.6.140.0030.04720.84
5.6.130.0030.04320.93
5.6.120.0070.05320.84
5.6.110.0000.05120.92
5.6.100.0030.04620.94
5.6.90.0040.04420.81
5.6.80.0070.04620.31
5.6.70.0060.03920.35
5.6.60.0040.06020.36
5.6.50.0000.04420.34
5.6.40.0070.04420.29
5.6.30.0000.05520.30
5.6.20.0000.05320.18
5.6.10.0090.04120.16
5.6.00.0040.05220.27
5.5.380.0000.05517.52
5.5.370.0070.03817.41
5.5.360.0030.04117.56
5.5.350.0100.04217.52
5.5.340.0000.04417.70
5.5.330.0000.04417.84
5.5.320.0070.05017.71
5.5.310.0060.03818.00
5.5.300.0030.04117.72
5.5.290.0100.05717.84
5.5.280.0070.03618.11
5.5.270.0030.04518.12
5.5.260.0030.04518.11
5.5.250.0100.03517.93
5.5.240.0030.03817.22
5.5.230.0000.04117.08
5.5.220.0000.06617.40
5.5.210.0030.03717.23
5.5.200.0000.04017.41
5.5.190.0030.04917.11
5.5.180.0060.04217.35
5.5.160.0030.04017.45
5.5.150.0030.03817.36
5.5.140.0030.03817.47
5.5.130.0030.04217.21
5.5.120.0030.03917.46
5.5.110.0030.04117.44
5.5.100.0060.03517.30
5.5.90.0000.06016.95
5.5.80.0070.03316.99
5.5.70.0000.04717.34
5.5.60.0030.04217.36
5.5.50.0030.03617.32
5.5.40.0090.03117.08
5.5.30.0000.04317.24
5.5.20.0030.04517.36
5.5.10.0030.04417.27
5.5.00.0100.06417.29
5.4.450.0030.03819.44
5.4.440.0000.04319.40
5.4.430.0130.04219.55
5.4.420.0100.04419.40
5.4.410.0070.04019.33
5.4.400.0000.04219.14
5.4.390.0030.06019.08
5.4.380.0070.03919.09
5.4.370.0000.04118.92
5.4.360.0030.03819.15
5.4.350.0030.03719.11
5.4.340.0030.03819.06
5.4.320.0070.04818.90
5.4.310.0070.03419.25
5.4.300.0030.03718.98
5.4.290.0000.04119.17
5.4.280.0030.06319.06
5.4.270.0060.03418.94
5.4.260.0060.03419.20
5.4.250.0090.03419.15
5.4.240.0190.02819.08
5.4.230.0030.03719.08
5.4.220.0070.04319.07
5.4.210.0070.03318.96
5.4.200.0060.03618.98
5.4.190.0000.04818.88
5.4.180.0030.04119.11
5.4.170.0070.04419.13
5.4.160.0000.04319.19
5.4.150.0170.03618.89
5.4.140.0000.04616.54
5.4.130.0000.08016.66
5.4.120.0070.03116.76
5.4.110.0030.03916.54
5.4.100.0000.03816.71
5.4.90.0000.05116.71
5.4.80.0030.07416.47
5.4.70.0000.03716.39
5.4.60.0040.03616.75
5.4.50.0070.07916.73
5.4.40.0000.07516.80
5.4.30.0030.03616.47
5.4.20.0000.03916.73
5.4.10.0000.06816.67
5.4.00.0030.05216.21
5.3.290.0000.04315.54
5.3.280.0030.03815.54
5.3.270.0030.03915.54
5.3.260.0100.03015.54
5.3.250.0030.06015.54
5.3.240.0100.07215.54
5.3.230.0140.06815.54
5.3.220.0040.03915.54
5.3.210.0090.03115.54
5.3.200.0000.03915.54
5.3.190.0100.07215.54
5.3.180.0030.06715.54
5.3.170.0030.06615.54
5.3.160.0100.05315.54
5.3.150.0030.04215.54
5.3.140.0030.03915.54
5.3.130.0060.03615.54
5.3.120.0070.03215.54
5.3.110.0100.04015.54
5.3.100.0000.04115.54
5.3.90.0070.03315.54
5.3.80.0000.04215.54
5.3.70.0070.06015.54
5.3.60.0030.03415.54
5.3.50.0030.05715.54
5.3.40.0030.07115.54
5.3.30.0000.03915.54
5.3.20.0030.04115.54
5.3.10.0040.03315.54
5.3.00.0030.03415.54
5.2.170.0000.03715.54
5.2.160.0070.04615.54
5.2.150.0000.03215.54
5.2.140.0030.03215.54
5.2.130.0040.03215.54
5.2.120.0030.02715.54
5.2.110.0030.05015.54
5.2.100.0130.02915.54
5.2.90.0000.03015.54
5.2.80.0000.04215.54
5.2.70.0000.03415.54
5.2.60.0130.02915.54
5.2.50.0060.02515.54
5.2.40.0070.03915.54
5.2.30.0000.06615.54
5.2.20.0000.03215.54
5.2.10.0030.02715.54
5.2.00.0000.03315.54
5.1.60.0000.02815.54
5.1.50.0070.03415.54
5.1.40.0030.04515.54
5.1.30.0030.02615.54
5.1.20.0030.03815.54
5.1.10.0030.02315.54
5.1.00.0000.04715.54
5.0.50.0030.03815.54
5.0.40.0000.02215.54
5.0.30.0070.04615.54
5.0.20.0030.01715.54
5.0.10.0030.04715.54
5.0.00.0030.04915.54
4.4.90.0070.01015.54
4.4.80.0000.01715.54
4.4.70.0000.01715.54
4.4.60.0030.01415.54
4.4.50.0000.01615.54
4.4.40.0060.02915.54
4.4.30.0000.01615.54
4.4.20.0000.01615.54
4.4.10.0070.01415.54
4.4.00.0030.03115.54
4.3.110.0030.01915.54
4.3.100.0040.01415.54
4.3.90.0060.01215.54
4.3.80.0030.05815.54
4.3.70.0060.02315.54
4.3.60.0000.03515.54
4.3.50.0000.02715.54
4.3.40.0000.02615.54
4.3.30.0030.01415.54
4.3.20.0060.01215.54
4.3.10.0000.01815.54
4.3.00.0030.01315.54

preferences:
47.69 ms | 401 KiB | 5 Q