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, 4, 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.0120.00616.38
8.3.50.0100.00318.14
8.3.40.0140.00718.60
8.3.30.0060.00918.63
8.3.20.0070.00721.95
8.3.10.0040.00421.86
8.3.00.0040.00419.64
8.2.180.0180.00316.50
8.2.170.0140.00322.96
8.2.160.0110.00720.44
8.2.150.0000.00824.18
8.2.140.0080.00824.66
8.2.130.0040.00419.27
8.2.120.0070.00026.35
8.2.110.0090.01319.30
8.2.100.0120.00017.53
8.2.90.0050.00317.84
8.2.80.0060.00318.03
8.2.70.0040.00417.89
8.2.60.0040.00417.90
8.2.50.0030.00618.10
8.2.40.0040.00420.64
8.2.30.0040.00419.44
8.2.20.0000.00717.87
8.2.10.0060.00318.00
8.2.00.0070.00017.86
8.1.280.0150.00025.92
8.1.270.0000.00723.79
8.1.260.0050.00326.35
8.1.250.0070.00028.09
8.1.240.0110.00023.82
8.1.230.0080.00422.68
8.1.220.0030.00617.74
8.1.210.0040.00418.77
8.1.200.0040.00417.23
8.1.190.0040.00416.97
8.1.180.0040.00418.10
8.1.170.0070.00018.84
8.1.160.0080.00018.73
8.1.150.0030.00318.96
8.1.140.0040.00417.62
8.1.130.0000.00718.88
8.1.120.0000.00717.36
8.1.110.0040.00417.26
8.1.100.0070.00017.27
8.1.90.0040.00417.25
8.1.80.0040.00417.23
8.1.70.0070.00017.33
8.1.60.0000.00917.50
8.1.50.0040.00417.53
8.1.40.0000.00717.50
8.1.30.0040.00417.53
8.1.20.0040.00417.60
8.1.10.0040.00417.46
8.1.00.0000.00717.43
8.0.300.0060.00319.86
8.0.290.0050.00316.63
8.0.280.0000.00718.36
8.0.270.0000.00717.20
8.0.260.0040.00417.21
8.0.250.0000.00816.80
8.0.240.0030.00316.82
8.0.230.0050.00316.83
8.0.220.0070.00016.70
8.0.210.0050.00316.84
8.0.200.0030.00316.82
8.0.190.0000.00716.79
8.0.180.0060.00316.82
8.0.170.0000.01016.77
8.0.160.0000.00716.86
8.0.150.0040.00316.66
8.0.140.0040.00416.60
8.0.130.0030.00313.14
8.0.120.0050.00316.71
8.0.110.0000.00716.79
8.0.100.0070.00016.73
8.0.90.0000.00716.75
8.0.80.0030.01116.79
8.0.70.0020.00516.74
8.0.60.0030.00516.64
8.0.50.0040.00416.63
8.0.30.0110.01017.00
8.0.20.0100.00717.40
8.0.10.0000.00716.75
8.0.00.0090.00816.61
7.4.330.0000.00515.55
7.4.320.0030.00316.43
7.4.300.0030.00316.55
7.4.290.0030.00316.43
7.4.280.0040.00416.52
7.4.270.0040.00416.46
7.4.260.0000.00716.55
7.4.250.0000.00716.46
7.4.240.0070.00016.48
7.4.230.0070.00016.38
7.4.220.0000.00916.38
7.4.210.0070.00916.52
7.4.200.0070.00016.36
7.4.160.0080.00816.43
7.4.140.0110.01017.86
7.4.130.0030.01516.44
7.4.120.0060.01216.55
7.4.110.0100.00716.25
7.4.100.0090.01416.43
7.4.90.0100.01016.65
7.4.80.0130.00619.39
7.4.70.0130.01016.31
7.4.60.0030.01316.40
7.4.50.0100.00616.17
7.4.40.0080.00816.71
7.4.10.0110.00714.88
7.4.00.0090.00714.86
7.3.330.0050.00013.18
7.3.320.0030.00313.14
7.3.310.0050.00316.24
7.3.300.0030.00316.34
7.3.290.0000.00716.24
7.3.280.0080.01016.28
7.3.260.0060.01116.55
7.3.240.0050.01216.46
7.3.230.0060.01216.55
7.3.210.0070.01016.29
7.3.200.0000.01616.66
7.3.190.0090.00616.34
7.3.180.0150.00316.46
7.3.170.0060.01216.36
7.3.160.0030.01316.41
7.3.130.0070.01014.93
7.3.120.0130.00314.96
7.3.110.0060.01014.65
7.3.100.0000.01714.56
7.3.90.0090.00914.82
7.3.80.0030.00614.42
7.3.70.0090.00314.82
7.3.60.0060.00614.89
7.3.50.0060.01014.79
7.3.40.0040.00414.86
7.3.30.0040.01114.81
7.3.20.0060.00616.72
7.3.10.0060.00416.59
7.3.00.0100.00316.45
7.2.330.0090.01216.72
7.2.320.0130.00316.67
7.2.310.0030.01516.52
7.2.300.0030.01516.70
7.2.290.0000.02216.64
7.2.260.0100.01015.00
7.2.250.0000.01814.93
7.2.240.0000.01315.11
7.2.230.0060.00914.61
7.2.220.0070.01114.95
7.2.210.0110.00015.13
7.2.200.0060.01015.00
7.2.190.0030.01315.02
7.2.180.0090.00315.07
7.2.170.0030.00914.94
7.2.160.0030.00715.09
7.2.150.0060.00916.70
7.2.140.0060.00616.78
7.2.130.0070.00816.68
7.2.120.0030.01016.93
7.2.110.0090.00516.66
7.2.100.0050.00616.71
7.2.90.0000.01416.96
7.2.80.0060.00616.71
7.2.70.0060.00516.91
7.2.60.0050.00816.76
7.2.50.0090.00516.86
7.2.40.0250.01017.28
7.2.30.0280.00817.18
7.2.20.0170.01117.39
7.2.10.0170.01117.14
7.2.00.0180.00717.23
7.1.330.0090.00615.88
7.1.320.0100.00715.92
7.1.310.0060.00615.50
7.1.300.0040.01215.79
7.1.290.0030.01015.73
7.1.280.0030.00915.93
7.1.270.0000.01315.42
7.1.260.0040.00415.57
7.1.250.0100.00415.69
7.1.240.0000.00915.65
7.1.230.0030.00615.71
7.1.220.0060.00615.52
7.1.210.0040.00815.78
7.1.200.0030.01015.76
7.1.190.0040.01115.74
7.1.180.0000.00815.64
7.1.170.0070.00715.71
7.1.160.0290.01316.39
7.1.150.0320.01316.32
7.1.140.0370.01216.36
7.1.130.0230.01116.52
7.1.120.0270.01016.24
7.1.110.0290.00715.89
7.1.100.0420.00716.09
7.1.90.0230.00916.01
7.1.80.0210.01016.09
7.1.70.0180.01215.64
7.1.60.0300.01324.32
7.1.50.0440.01324.35
7.1.40.0440.01424.17
7.1.30.0350.00724.23
7.1.20.0320.00824.03
7.1.10.0310.01515.19
7.1.00.0290.01315.25
7.0.330.0060.00615.23
7.0.320.0090.00315.41
7.0.310.0070.00415.39
7.0.300.0060.00915.34
7.0.290.0070.00315.39
7.0.280.0090.00315.38
7.0.270.0000.01315.24
7.0.260.0070.00715.36
7.0.250.0110.00415.22
7.0.240.0000.01215.39
7.0.230.0030.01015.53
7.0.220.0000.01415.57
7.0.210.0120.00315.58
7.0.200.0040.01515.39
7.0.190.0040.01115.36
7.0.180.0030.00715.24
7.0.170.0060.00315.61
7.0.160.0100.00315.43
7.0.150.0120.00915.37
7.0.140.0070.01115.46
7.0.130.0080.00815.54
7.0.120.0080.00015.54
7.0.110.0000.01215.34
7.0.100.0070.00715.41
7.0.90.0070.00715.34
7.0.80.0040.00815.43
7.0.70.0060.00615.50
7.0.60.0060.00615.41
7.0.50.0030.01015.11
7.0.40.0120.00313.40
7.0.30.0070.00313.46
7.0.20.0070.00713.40
7.0.10.0090.00613.26
7.0.00.0000.01213.23
5.6.400.0030.00614.13
5.6.390.0060.00314.37
5.6.380.0130.00014.21
5.6.370.0030.01214.30
5.6.360.0080.00814.09
5.6.350.0030.00513.90
5.6.340.0130.00014.45
5.6.330.0090.00614.57
5.6.320.0060.00614.33
5.6.310.0060.00914.54
5.6.300.0070.01114.35
5.6.290.0130.00614.50
5.6.280.0000.01214.16
5.6.270.0060.00614.16
5.6.260.0040.01114.58
5.6.250.0060.00614.51
5.6.240.0100.00614.29
5.6.230.0060.00314.37
5.6.220.0030.01014.46
5.6.210.0040.01114.48
5.6.200.0070.00714.52
5.6.190.0030.00914.36
5.6.180.0090.00614.07
5.6.170.0070.00714.35
5.6.160.0030.00914.20
5.6.150.0030.00914.21
5.6.140.0040.01214.27
5.6.130.0000.01814.34
5.6.120.0040.01114.13
5.6.110.0000.01014.19
5.6.100.0050.00513.91
5.6.90.0040.00814.30
5.6.80.0080.00413.95
5.6.70.0000.01414.15
5.6.60.0000.01313.95
5.6.50.0000.01614.06
5.6.40.0030.00614.10
5.6.30.0060.00614.05
5.6.20.0080.00313.99
5.6.10.0090.00614.21
5.6.00.0030.01013.93

preferences:
58.58 ms | 400 KiB | 5 Q