3v4l.org

run code in 300+ PHP versions simultaneously
<?php function hasMatchingBits($x, $y) { $x = strrev(decbin($x)); $y = strrev(decbin($y)); $lengthX = strlen($x); $lengthY = strlen($y); $length = $lengthX < $lengthY ? $lengthX : $lengthY; for ($i = 0; $i < $length; $i++) { if ($x[$i] === '1' && $y[$i] === '1') { return true; } } return false; } echo hasMatchingBits(196, 4) ? "Yes\n" : "No\n"; echo hasMatchingBits(196, 16) ? "Yes\n" : "No\n"; echo hasMatchingBits(4, 16) ? "Yes\n" : "No\n";

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.4.140.0100.01317.88
8.4.130.0100.01217.80
8.4.120.0110.00820.39
8.4.110.0100.01020.25
8.4.100.0090.00817.51
8.4.90.0100.00622.27
8.4.80.0100.00918.96
8.4.70.0070.01218.82
8.4.60.0100.00819.14
8.4.50.0090.00719.01
8.4.40.0060.00919.28
8.4.30.0000.00918.78
8.4.20.0100.01020.45
8.4.10.0000.00917.88
8.3.270.0100.01116.45
8.3.260.0100.00616.43
8.3.250.0110.00718.86
8.3.240.0070.00316.28
8.3.230.0080.01116.56
8.3.220.0050.00318.85
8.3.210.0040.00418.30
8.3.200.0050.00416.81
8.3.190.0040.00417.21
8.3.180.0120.00716.73
8.3.170.0120.00619.02
8.3.160.0000.00717.20
8.3.150.0190.00018.29
8.3.140.0120.00617.41
8.3.130.0130.00316.67
8.3.120.0100.01018.71
8.3.110.0060.01316.48
8.3.100.0110.00820.16
8.3.90.0080.00026.77
8.3.80.0080.00319.36
8.3.70.0200.00018.18
8.3.60.0170.00016.38
8.3.50.0100.00723.63
8.3.40.0150.00318.79
8.3.30.0110.00418.84
8.3.20.0050.00220.75
8.3.10.0030.00521.95
8.3.00.0040.00421.90
8.2.290.0120.00816.69
8.2.280.0120.00620.35
8.2.270.0070.01020.57
8.2.260.0060.00316.67
8.2.250.0040.00417.13
8.2.240.0090.00917.12
8.2.230.0060.00320.94
8.2.220.0030.00624.06
8.2.210.0070.01126.77
8.2.200.0060.00318.88
8.2.190.0070.00716.58
8.2.180.0060.00918.18
8.2.170.0110.00422.96
8.2.160.0100.00322.12
8.2.150.0020.00525.66
8.2.140.0000.00824.66
8.2.130.0000.00726.16
8.2.120.0040.00426.16
8.2.110.0090.00920.35
8.2.100.0080.00417.72
8.2.90.0090.00017.63
8.2.80.0000.00818.91
8.2.70.0080.00017.75
8.2.60.0000.00817.38
8.2.50.0040.00417.63
8.2.40.0090.00021.38
8.2.30.0000.00719.22
8.2.20.0050.00218.00
8.2.10.0080.00019.29
8.2.00.0000.00719.32
8.1.330.0100.00915.93
8.1.320.0070.01317.90
8.1.310.0070.01018.17
8.1.300.0090.00016.79
8.1.290.0000.00930.84
8.1.280.0120.00325.92
8.1.270.0080.00020.39
8.1.260.0080.00026.35
8.1.250.0000.00928.09
8.1.240.0060.00323.71
8.1.230.0110.00022.72
8.1.220.0030.00518.61
8.1.210.0040.00418.77
8.1.200.0040.00417.53
8.1.190.0000.00817.35
8.1.180.0060.00318.10
8.1.170.0110.00018.65
8.1.160.0040.00418.93
8.1.150.0000.00719.06
8.1.140.0000.00720.67
8.1.130.0070.00020.25
8.1.120.0090.00017.34
8.1.110.0040.00417.35
8.1.100.0040.00417.45
8.1.90.0000.00717.50
8.1.80.0030.00517.46
8.1.70.0040.00417.45
8.1.60.0080.00017.59
8.1.50.0030.00617.40
8.1.40.0000.00817.50
8.1.30.0000.01017.55
8.1.20.0040.00417.63
8.1.10.0030.00517.43
8.1.00.0040.00417.43
8.0.300.0000.00718.93
8.0.290.0000.00716.75
8.0.280.0070.00018.45
8.0.270.0080.00016.75
8.0.260.0030.00320.00
8.0.250.0000.00716.96
8.0.240.0030.00516.82
8.0.230.0030.00316.86
8.0.220.0030.00316.88
8.0.210.0040.00316.93
8.0.200.0030.00316.82
8.0.190.0030.00516.97
8.0.180.0000.00716.94
8.0.170.0090.00016.96
8.0.160.0000.00716.94
8.0.150.0040.00416.84
8.0.140.0070.00416.86
8.0.130.0050.00013.31
8.0.120.0040.00416.88
8.0.110.0040.00416.86
8.0.100.0080.00016.76
8.0.90.0040.00416.93
8.0.80.0090.01016.93
8.0.70.0000.00716.95
8.0.60.0050.00316.98
8.0.50.0040.00416.85
8.0.30.0100.00717.12
8.0.20.0170.00317.16
8.0.10.0050.00216.83
8.0.00.0030.01316.79
7.4.330.0060.00016.81
7.4.320.0000.00616.61
7.4.300.0000.00616.46
7.4.290.0080.00016.50
7.4.280.0030.00616.48
7.4.270.0070.00016.40
7.4.260.0100.00016.37
7.4.250.0040.00416.54
7.4.240.0040.00316.56
7.4.230.0050.00216.56
7.4.220.0040.00416.46
7.4.210.0070.00916.57
7.4.200.0000.00716.50
7.4.130.0110.00816.46
7.4.120.0080.01116.52
7.4.110.0130.00316.61
7.4.100.0060.01616.46
7.4.90.0060.01816.48
7.4.80.0060.01219.39
7.4.70.0100.00616.54
7.4.60.0130.00316.61
7.4.50.0040.01116.38
7.4.40.0120.00416.34
7.4.10.0120.00816.36
7.4.00.0090.01016.56
7.3.330.0000.00716.37
7.3.320.0050.00013.25
7.3.310.0070.00016.39
7.3.300.0030.00316.24
7.3.290.0080.00716.36
7.3.260.0120.00616.28
7.3.240.0080.00816.51
7.3.230.0080.01116.43
7.3.210.0060.01216.50
7.3.200.0060.01316.45
7.3.190.0130.00316.59
7.3.180.0070.01016.50
7.3.170.0090.00616.39
7.3.160.0120.00616.56
7.3.130.0090.00616.47
7.3.120.0070.01116.42
7.3.110.0160.00316.41
7.3.100.0030.01216.62
7.3.90.0100.00716.61
7.3.80.0110.00616.64
7.3.70.0100.00616.33
7.3.60.0130.00316.57
7.3.50.0000.01516.38
7.3.40.0170.00316.48
7.3.30.0080.00816.23
7.3.20.0150.00316.34
7.3.10.0090.01116.35
7.3.00.0090.00916.34
7.2.330.0100.00716.61
7.2.320.0070.01416.69
7.2.310.0060.00916.82
7.2.300.0150.00616.64
7.2.290.0110.00716.71
7.2.260.0150.00616.82
7.2.250.0150.00316.78
7.2.240.0100.00616.88
7.2.230.0000.01916.46
7.2.220.0100.00716.36
7.2.210.0090.00616.76
7.2.200.0130.00416.61
7.2.190.0090.00916.55
7.2.180.0080.01416.67
7.2.170.0070.01416.57
7.2.160.0070.01016.73
7.2.150.0090.00916.80
7.2.140.0110.00816.67
7.2.130.0140.00916.65
7.2.120.0060.01216.63
7.2.110.0130.00716.72
7.2.100.0130.00316.55
7.2.90.0120.00916.75
7.2.80.0120.00916.80
7.2.70.0090.00916.79
7.2.60.0100.01016.52
7.2.50.0110.00716.39
7.2.40.0100.01316.68
7.2.30.0060.01016.73
7.2.20.0110.00516.63
7.2.10.0100.01016.52
7.2.00.0130.01016.64

preferences:
30.97 ms | 403 KiB | 5 Q