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));

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.0140.00416.63
8.3.50.0070.00718.02
8.3.40.0110.00818.98
8.3.30.0070.00718.85
8.3.20.0090.00921.95
8.3.10.0050.00221.90
8.3.00.0080.00019.69
8.2.180.0110.00816.75
8.2.170.0090.00622.96
8.2.160.0170.00020.42
8.2.150.0080.00024.18
8.2.140.0070.00724.66
8.2.130.0000.00819.21
8.2.120.0050.00326.35
8.2.110.0060.00321.03
8.2.100.0040.00817.97
8.2.90.0090.00018.96
8.2.80.0080.00017.97
8.2.70.0030.00517.93
8.2.60.0050.00317.93
8.2.50.0020.00518.10
8.2.40.0050.00220.59
8.2.30.0090.00019.37
8.2.20.0000.00818.09
8.2.10.0060.00617.92
8.2.00.0040.00418.07
8.1.280.0030.01225.92
8.1.270.0070.00023.79
8.1.260.0020.00526.35
8.1.250.0070.00028.09
8.1.240.0030.00622.62
8.1.230.0040.00717.83
8.1.220.0040.00417.76
8.1.210.0030.00618.77
8.1.200.0060.00317.23
8.1.190.0040.00417.25
8.1.180.0040.00418.10
8.1.170.0040.00418.65
8.1.160.0000.00818.86
8.1.150.0070.00018.91
8.1.140.0030.00517.64
8.1.130.0050.00218.90
8.1.120.0070.00017.44
8.1.110.0030.00517.45
8.1.100.0000.00717.50
8.1.90.0030.00517.36
8.1.80.0000.00717.45
8.1.70.0000.00717.48
8.1.60.0090.00017.64
8.1.50.0000.00717.49
8.1.40.0080.00017.41
8.1.30.0080.00017.61
8.1.20.0000.00717.67
8.1.10.0050.00317.49
8.1.00.0000.00717.46
8.0.300.0040.00418.77
8.0.290.0040.00416.75
8.0.280.0000.00718.45
8.0.270.0040.00417.21
8.0.260.0000.00617.27
8.0.250.0080.00016.95
8.0.240.0000.00716.89
8.0.230.0030.00317.01
8.0.220.0030.00316.87
8.0.210.0080.00017.00
8.0.200.0030.00317.04
8.0.190.0050.00317.00
8.0.180.0040.00416.90
8.0.170.0040.00716.87
8.0.160.0070.00016.93
8.0.150.0000.00817.03
8.0.140.0000.00716.88
8.0.130.0050.00013.41
8.0.120.0070.00016.84
8.0.110.0080.00016.85
8.0.100.0040.00317.02
8.0.90.0030.00316.84
8.0.80.0030.01216.99
8.0.70.0030.00617.02
8.0.60.0090.00016.86
8.0.50.0000.00816.76
8.0.30.0110.00917.15
8.0.20.0060.01417.40
8.0.10.0040.00417.11
8.0.00.0090.00916.65
7.4.330.0060.00015.55
7.4.320.0030.00316.63
7.4.300.0000.00716.64
7.4.290.0030.00316.62
7.4.280.0030.00516.66
7.4.270.0070.00016.64
7.4.260.0000.00716.42
7.4.250.0030.00516.41
7.4.240.0030.00316.53
7.4.230.0000.00816.61
7.4.220.0040.00416.56
7.4.210.0120.00716.60
7.4.200.0000.00716.35
7.4.160.0060.01016.50
7.4.140.0120.00817.86
7.4.130.0100.01416.44
7.4.120.0110.00916.50
7.4.110.0110.00616.49
7.4.100.0090.00916.47
7.4.90.0140.00316.50
7.4.80.0100.01319.39
7.4.70.0110.01016.46
7.4.60.0150.00316.58
7.4.50.0070.00716.39
7.4.40.0030.01416.37
7.4.00.0090.00615.05
7.3.330.0030.00313.23
7.3.320.0030.00313.52
7.3.310.0070.00016.55
7.3.300.0030.00316.45
7.3.290.0070.00016.39
7.3.280.0060.01016.39
7.3.260.0100.00916.44
7.3.240.0060.01316.56
7.3.230.0030.01416.58
7.3.210.0150.00316.41
7.3.200.0110.01016.52
7.3.190.0080.00916.56
7.3.180.0140.00316.54
7.3.170.0110.00716.42
7.3.160.0080.00816.70
7.3.120.0140.00314.93
7.3.110.0030.01215.08
7.3.100.0040.01414.96
7.3.90.0040.01114.68
7.3.80.0210.00714.59
7.3.70.0040.00814.71
7.3.60.0090.01414.82
7.3.50.0160.00014.93
7.3.40.0060.01514.91
7.3.30.0090.00614.68
7.3.20.0100.00616.81
7.3.10.0070.01016.62
7.3.00.0080.00516.32
7.2.330.0060.01216.44
7.2.320.0090.00916.45
7.2.310.0100.01016.79
7.2.300.0070.01316.66
7.2.290.0060.01216.70
7.2.250.0030.01615.26
7.2.240.0070.01115.20
7.2.230.0060.01015.06
7.2.220.0000.01414.61
7.2.210.0220.00814.98
7.2.200.0180.01114.88
7.2.190.0190.01114.79
7.2.180.0240.00314.91
7.2.170.0170.01014.98
7.2.60.0030.01016.73
7.2.50.0100.00316.88
7.2.40.0330.01617.96
7.2.30.1400.01217.74
7.2.20.0500.01117.81
7.2.10.0530.01318.09
7.2.00.0530.01018.09
7.1.330.0040.01115.62
7.1.320.0070.01715.75
7.1.310.0060.00915.79
7.1.300.0140.01015.54
7.1.290.0130.00815.91
7.1.280.0070.01115.79
7.1.270.0110.00715.78
7.1.260.0060.01215.64
7.1.200.0000.00715.70
7.1.160.0450.01216.82
7.1.150.0580.01317.06
7.1.140.0650.01017.15
7.1.130.0480.01016.53
7.1.120.0530.00916.56
7.1.110.0690.01515.72
7.1.100.0570.00916.20
7.1.90.0690.01315.98
7.1.80.0570.01215.91
7.1.70.0470.00815.44
7.1.60.0590.01833.11
7.1.50.0730.01533.06
7.1.40.0780.01932.54
7.1.30.0820.01932.92
7.1.20.0650.01832.69
7.1.10.0670.01414.69
7.1.00.0500.01114.77

preferences:
57.52 ms | 400 KiB | 5 Q