3v4l.org

run code in 300+ PHP versions simultaneously
<?php function highestBitsOfByte(int $byte, int $count = 2):int { if($count < 0 OR $count > 8) return false; //Error return ($byte&0xFF) >> (8-$count); } $input = 0b10011110; $r = highestBitsOfByte($input,2); echo sprintf('%08b',$r);

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.0110.01117.70
8.4.130.0080.01019.70
8.4.120.0110.00920.75
8.4.110.0110.01022.24
8.4.100.0120.00818.48
8.4.90.0130.00718.77
8.4.80.0080.00419.55
8.4.70.0110.00918.00
8.4.60.0110.00918.91
8.4.50.0050.00419.61
8.4.40.0040.01520.45
8.4.30.0060.01318.77
8.4.20.0100.01019.70
8.4.10.0060.00924.10
8.3.270.0100.01116.71
8.3.260.0110.00816.55
8.3.250.0110.00818.67
8.3.240.0110.00816.73
8.3.230.0060.00616.66
8.3.220.0090.00917.14
8.3.210.0050.00216.70
8.3.200.0060.00516.68
8.3.190.0070.00117.27
8.3.180.0100.00918.31
8.3.170.0160.00318.86
8.3.160.0070.01116.55
8.3.150.0080.00019.09
8.3.140.0110.00720.67
8.3.130.0030.00618.44
8.3.120.0060.00319.11
8.3.110.0180.00020.94
8.3.100.0040.00424.06
8.3.90.0040.00426.77
8.3.80.0060.00318.30
8.3.70.0120.00316.75
8.3.60.0070.00716.63
8.3.50.0070.00718.38
8.3.40.0090.00920.01
8.3.30.0110.00418.44
8.3.20.0000.00724.18
8.3.10.0070.00024.66
8.3.00.0040.00426.16
8.2.290.0050.00620.36
8.2.280.0090.00818.27
8.2.270.0150.00416.78
8.2.260.0040.01118.93
8.2.250.0000.00818.62
8.2.240.0040.00417.19
8.2.230.0040.00422.58
8.2.220.0080.00437.54
8.2.210.0040.00426.77
8.2.200.0040.00816.38
8.2.190.0140.00316.58
8.2.180.0060.00925.92
8.2.170.0070.01122.96
8.2.160.0120.00322.96
8.2.150.0040.00425.66
8.2.140.0030.00624.66
8.2.130.0000.00726.16
8.2.120.0040.00426.16
8.2.110.0030.00719.03
8.2.100.0130.00017.59
8.2.90.0000.00919.25
8.2.80.0040.00417.97
8.2.70.0080.00017.63
8.2.60.0030.00517.93
8.2.50.0000.00818.07
8.2.40.0030.00519.75
8.2.30.0040.00418.00
8.2.20.0040.00420.53
8.2.10.0030.00418.35
8.2.00.0070.00019.30
8.1.330.0100.00822.17
8.1.320.0090.01016.07
8.1.310.0000.00816.45
8.1.300.0090.00618.59
8.1.290.0030.00630.84
8.1.280.0090.00925.92
8.1.270.0000.00924.66
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0030.00619.20
8.1.230.0080.00317.77
8.1.220.0040.00417.74
8.1.210.0050.00318.77
8.1.200.0060.00317.35
8.1.190.0080.00017.23
8.1.180.0030.00618.10
8.1.170.0000.00918.46
8.1.160.0020.00518.93
8.1.150.0050.00318.59
8.1.140.0000.00717.41
8.1.130.0060.00317.37
8.1.120.0000.00817.38
8.1.110.0060.00317.55
8.1.100.0050.00217.37
8.1.90.0040.00417.55
8.1.80.0040.00417.46
8.1.70.0000.00717.46
8.1.60.0080.00017.53
8.1.50.0030.00517.57
8.1.40.0000.00817.60
8.1.30.0060.00317.50
8.1.20.0030.00617.66
8.1.10.0020.00517.45
8.1.00.0030.00617.50
8.0.300.0030.00618.77
8.0.290.0000.00816.63
8.0.280.0070.00018.31
8.0.270.0000.00716.69
8.0.260.0060.00317.37
8.0.250.0050.00317.37
8.0.240.0000.00917.37
8.0.230.0000.00817.37
8.0.220.0070.00017.37
8.0.210.0030.00317.37
8.0.200.0000.00717.37
8.0.190.0000.00817.37
8.0.180.0080.00017.37
8.0.170.0050.00317.37
8.0.160.0040.00417.37
8.0.150.0040.00417.37
8.0.140.0030.00517.37
8.0.130.0090.00017.37
8.0.120.0000.00717.37
8.0.110.0040.00417.37
8.0.100.0060.00317.37
8.0.90.0060.00317.37
8.0.80.0030.00717.37
8.0.70.0000.01017.37
8.0.60.0070.00017.37
8.0.50.0030.00317.37
8.0.30.0050.00317.37
8.0.20.0000.00717.37
8.0.10.0040.00417.37

preferences:
91.28 ms | 403 KiB | 5 Q