3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Get bit in specified position from right (LSB position = 0) function getBIT($number, $position) { return ($number >> $position) & 1;} // Set bit in specified position from right (LSB position = 0) function setBIT($number, $position, $value) { if(getBIT($number, $position)){ if(!$value) { $number -= pow(2, $position); if($color == "r"){ $setBITcountR++; //echo "set BITr "; } if($color == "g"){ $setBITcountG++; //echo "set BITg "; } if($color == "b"){ $setBITcountB++; //echo "set BITb "; } } } else { if($value){ $number += pow(2, $position); if($color == "r"){ $setBITcountR++; //echo "set BITr "; } if($color == "g"){ $setBITcountG++; //echo "set BITg "; } if($color == "b"){ $setBITcountB++; //echo "set BITb "; } } } return $number; } //echo decbin(setBIT(0b01101001, 3, 0)); echo getBIT(0b01101001, 2);

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.0090.01316.63
8.3.50.0070.00717.86
8.3.40.0150.00618.84
8.3.30.0060.00918.59
8.3.20.0040.00421.81
8.3.10.0080.00021.76
8.3.00.0000.00819.56
8.2.180.0070.01316.50
8.2.170.0140.00522.96
8.2.160.0110.00620.35
8.2.150.0060.00324.18
8.2.140.0040.00424.66
8.2.130.0070.00019.45
8.2.120.0090.00026.35
8.2.110.0050.00519.32
8.2.100.0070.00317.78
8.2.90.0060.00317.78
8.2.80.0000.00818.16
8.2.70.0050.00317.91
8.2.60.0040.00417.90
8.2.50.0040.00418.10
8.2.40.0000.00720.47
8.2.30.0060.00319.31
8.2.20.0080.00018.11
8.2.10.0050.00519.78
8.2.00.0030.00617.95
8.1.280.0140.00725.92
8.1.270.0040.00422.19
8.1.260.0000.00826.35
8.1.250.0070.00028.09
8.1.240.0060.00322.38
8.1.230.0110.00022.63
8.1.220.0000.00817.74
8.1.210.0080.00018.77
8.1.200.0080.00017.22
8.1.190.0030.00517.13
8.1.180.0000.00818.10
8.1.170.0040.00418.90
8.1.160.0040.00418.68
8.1.150.0020.00518.85
8.1.140.0030.00517.54
8.1.130.0070.00318.83
8.1.120.0000.00717.27
8.1.110.0050.00317.22
8.1.100.0050.00317.34
8.1.90.0050.00317.34
8.1.80.0000.00717.34
8.1.70.0070.00017.30
8.1.60.0000.00917.52
8.1.50.0040.00417.40
8.1.40.0000.00717.48
8.1.30.0000.00817.58
8.1.20.0030.00617.42
8.1.10.0030.00617.32
8.1.00.0070.00017.25
8.0.300.0000.00719.98
8.0.290.0080.00016.63
8.0.280.0030.00318.39
8.0.270.0000.00717.12
8.0.260.0000.00617.20
8.0.250.0030.00316.88
8.0.240.0030.00316.95
8.0.230.0020.00516.87
8.0.220.0000.00716.76
8.0.210.0070.00016.81
8.0.200.0000.00716.83
8.0.190.0000.00716.84
8.0.180.0040.00416.75
8.0.170.0080.00316.83
8.0.160.0000.00716.67
8.0.150.0070.00016.60
8.0.140.0040.00416.64
8.0.130.0030.00313.23
8.0.120.0000.00816.70
8.0.110.0050.00316.61
8.0.100.0000.00716.79
8.0.90.0050.00216.81
8.0.80.0100.01016.76
8.0.70.0030.00316.64
8.0.60.0040.00416.58
8.0.50.0050.00316.84
8.0.30.0060.01317.17
8.0.20.0100.00717.40
8.0.10.0030.00516.81
8.0.00.0080.01016.58
7.4.330.0050.00015.55
7.4.320.0060.00016.33
7.4.300.0000.00716.58
7.4.290.0000.00716.54
7.4.280.0000.00716.44
7.4.270.0070.00016.38
7.4.260.0050.00216.56
7.4.250.0000.00816.54
7.4.240.0030.00316.47
7.4.230.0030.00316.21
7.4.220.0070.00016.66
7.4.210.0050.01116.48
7.4.200.0000.00716.49
7.4.160.0090.00916.38
7.4.140.0060.01317.86
7.4.130.0040.01316.33
7.4.120.0100.01116.48
7.4.110.0100.00716.41
7.4.100.0120.00616.39
7.4.90.0140.01016.54
7.4.80.0110.01219.39
7.4.70.0150.00616.52
7.4.60.0100.00716.42
7.4.50.0060.00916.41
7.4.40.0030.01316.21
7.4.00.0070.01014.69
7.3.330.0050.00013.31
7.3.320.0030.00313.34
7.3.310.0040.00416.36
7.3.300.0000.00716.36
7.3.290.0000.00716.18
7.3.280.0110.00416.24
7.3.260.0120.00716.46
7.3.240.0100.00916.47
7.3.230.0110.00516.57
7.3.210.0000.01616.28
7.3.200.0090.00816.52
7.3.190.0090.00616.44
7.3.180.0090.00916.32
7.3.170.0130.00316.39
7.3.160.0090.00616.46
7.3.120.0070.01115.05
7.3.110.0130.00314.83
7.3.100.0070.01114.98
7.3.90.0040.00815.08
7.3.80.0040.01114.79
7.3.70.0060.00614.88
7.3.60.0060.00914.58
7.3.50.0030.00914.64
7.3.40.0060.00314.55
7.3.30.0030.00614.64
7.3.20.0090.00616.70
7.3.10.0070.00716.77
7.3.00.0070.00816.63
7.2.330.0070.01016.34
7.2.320.0060.01216.40
7.2.310.0080.01016.48
7.2.300.0180.00316.39
7.2.290.0100.01016.70
7.2.250.0120.00415.11
7.2.240.0090.00915.20
7.2.230.0100.00614.84
7.2.220.0060.00915.26
7.2.210.0110.00714.92
7.2.200.0070.00715.03
7.2.190.0030.01014.64
7.2.180.0030.01215.03
7.2.170.0080.00814.99
7.2.60.0070.00716.67
7.2.50.0030.01016.91
7.2.40.0780.01717.86
7.2.30.0630.01318.05
7.2.20.0610.01317.73
7.2.10.0900.01118.24
7.2.00.1010.01818.08
7.1.330.0090.00315.67
7.1.320.0030.01015.83
7.1.310.0060.00815.84
7.1.300.0040.00815.71
7.1.290.0090.00615.60
7.1.280.0000.01415.79
7.1.270.0040.00815.66
7.1.260.0040.01115.61
7.1.200.0040.00815.66
7.1.160.0570.01316.93
7.1.150.0760.01816.79
7.1.140.0510.00916.86
7.1.130.0600.01017.06
7.1.120.0930.01516.58
7.1.110.0810.01115.86
7.1.100.0890.01516.13
7.1.90.0900.01416.38
7.1.80.0650.01116.13
7.1.70.0910.00815.05
7.1.60.0980.01833.13
7.1.50.0980.01632.82
7.1.40.0990.01532.43
7.1.30.0780.01232.57
7.1.20.0670.01032.54
7.1.10.0470.01214.55
7.1.00.0500.01214.75

preferences:
44.92 ms | 400 KiB | 5 Q