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, 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.0040.01216.63
8.3.50.0120.00617.90
8.3.40.0130.00318.54
8.3.30.0060.00918.72
8.3.20.0070.00021.85
8.3.10.0070.00021.72
8.3.00.0040.00419.56
8.2.180.0170.00316.38
8.2.170.0090.00922.96
8.2.160.0060.00920.39
8.2.150.0070.00324.18
8.2.140.0050.00324.66
8.2.130.0080.00019.39
8.2.120.0040.00426.35
8.2.110.0070.00320.42
8.2.100.0060.00617.78
8.2.90.0040.00717.78
8.2.80.0080.00018.09
8.2.70.0000.00817.90
8.2.60.0050.00318.04
8.2.50.0000.00718.22
8.2.40.0000.00720.40
8.2.30.0090.00019.34
8.2.20.0000.00717.88
8.2.10.0070.00317.82
8.2.00.0050.00217.95
8.1.280.0120.00625.92
8.1.270.0040.00422.14
8.1.260.0000.00826.35
8.1.250.0000.00828.09
8.1.240.0060.00323.86
8.1.230.0080.00422.02
8.1.220.0030.00517.74
8.1.210.0000.00818.77
8.1.200.0060.00317.25
8.1.190.0050.00317.11
8.1.180.0000.00918.10
8.1.170.0000.00718.78
8.1.160.0030.00518.72
8.1.150.0000.00819.01
8.1.140.0050.00317.64
8.1.130.0000.00818.96
8.1.120.0030.00317.34
8.1.110.0030.00517.25
8.1.100.0050.00217.17
8.1.90.0030.00517.26
8.1.80.0040.00417.39
8.1.70.0030.00317.36
8.1.60.0080.00017.56
8.1.50.0040.00417.50
8.1.40.0000.00817.30
8.1.30.0040.00417.66
8.1.20.0030.00517.57
8.1.10.0040.00417.42
8.1.00.0040.00417.37
8.0.300.0040.00419.85
8.0.290.0000.00816.63
8.0.280.0040.00318.32
8.0.270.0000.00717.20
8.0.260.0000.00617.20
8.0.250.0000.00716.96
8.0.240.0030.00316.84
8.0.230.0000.00816.86
8.0.220.0030.00316.83
8.0.210.0000.00716.81
8.0.200.0000.00716.68
8.0.190.0050.00316.73
8.0.180.0000.00716.70
8.0.170.0030.00716.77
8.0.160.0040.00416.70
8.0.150.0040.00416.73
8.0.140.0000.00716.63
8.0.130.0030.00313.24
8.0.120.0000.00716.79
8.0.110.0000.00716.81
8.0.100.0070.00016.79
8.0.90.0080.00016.67
8.0.80.0060.01016.82
8.0.70.0000.00816.72
8.0.60.0040.00416.74
8.0.50.0000.00716.84
8.0.30.0090.00917.06
8.0.20.0070.01017.46
8.0.10.0050.00316.73
8.0.00.0090.00916.77
7.4.330.0020.00215.55
7.4.320.0070.00016.49
7.4.300.0000.00716.56
7.4.290.0050.00316.57
7.4.280.0020.00516.44
7.4.270.0040.00416.46
7.4.260.0040.00416.59
7.4.250.0050.00216.46
7.4.240.0000.00816.46
7.4.230.0000.00716.45
7.4.220.0000.00716.46
7.4.210.0040.01216.61
7.4.200.0030.00316.28
7.4.160.0080.00916.55
7.4.140.0050.01317.86
7.4.130.0090.00916.54
7.4.120.0100.00916.51
7.4.110.0110.00816.36
7.4.100.0150.00316.60
7.4.90.0090.01216.70
7.4.80.0120.01019.39
7.4.70.0000.02216.50
7.4.60.0070.01016.43
7.4.50.0100.00716.58
7.4.40.0110.00516.53
7.4.10.0030.01414.91
7.4.00.0050.01015.00
7.3.330.0030.00313.19
7.3.320.0050.00013.24
7.3.310.0020.00516.17
7.3.300.0040.00416.19
7.3.290.0000.00716.18
7.3.280.0070.00916.29
7.3.260.0090.01016.41
7.3.240.0090.00816.48
7.3.230.0070.01016.47
7.3.210.0070.01016.40
7.3.200.0130.00416.61
7.3.190.0060.00916.64
7.3.180.0030.01316.42
7.3.170.0130.00316.64
7.3.160.0090.00616.47
7.3.130.0030.01515.02
7.3.120.0130.00714.99
7.3.110.0060.01314.93
7.3.100.0090.00615.03
7.3.90.0120.00314.75
7.3.80.0090.00314.81
7.3.70.0090.00614.89
7.3.60.0070.00714.86
7.3.50.0080.00414.85
7.3.40.0100.00314.84
7.3.30.0080.00814.76
7.3.20.0060.00316.70
7.3.10.0080.00616.48
7.3.00.0030.01116.47
7.2.330.0040.02216.56
7.2.320.0060.01216.39
7.2.310.0060.01116.78
7.2.300.0000.01716.46
7.2.290.0100.01016.34
7.2.260.0100.00714.54
7.2.250.0070.01014.95
7.2.240.0140.00015.13
7.2.230.0060.00915.09
7.2.220.0040.00815.25
7.2.210.0100.00715.00
7.2.200.0000.01815.09
7.2.190.0050.00515.04
7.2.180.0070.01015.08
7.2.170.0000.01415.12
7.2.160.0070.00415.02
7.2.150.0110.00317.00
7.2.140.0040.00717.06
7.2.130.0060.00816.86
7.2.120.0100.00616.71
7.2.110.0090.00516.82
7.2.100.0070.00716.86
7.2.90.0070.00616.82
7.2.80.0040.01316.83
7.2.70.0080.00816.83
7.2.60.0070.00616.76
7.2.50.0040.00916.87
7.2.40.0380.00817.10
7.2.30.0180.00817.02
7.2.20.0260.00717.11
7.2.10.0160.00917.12
7.2.00.0170.00717.00
7.1.330.0030.01315.69
7.1.320.0030.01015.48
7.1.310.0050.00515.81
7.1.300.0000.01315.58
7.1.290.0060.01015.82
7.1.280.0110.00315.75
7.1.270.0060.00915.72
7.1.260.0060.00615.77
7.1.250.0050.00715.70
7.1.240.0060.00515.59
7.1.230.0020.00915.73
7.1.220.0060.00715.71
7.1.210.0050.00715.54
7.1.200.0060.01015.73
7.1.190.0040.00615.58
7.1.180.0050.00715.52
7.1.170.0040.00615.66
7.1.160.0280.00816.00
7.1.150.0300.00616.03
7.1.140.0320.01116.18
7.1.130.0240.00816.15
7.1.120.0230.00915.96
7.1.110.0330.00815.93
7.1.100.0250.00615.81
7.1.90.0230.00715.76
7.1.80.0270.01015.81
7.1.70.0270.00715.33
7.1.60.0340.00921.65
7.1.50.0350.01321.48
7.1.40.0480.01321.35
7.1.30.0270.00621.28
7.1.20.0400.00921.26
7.1.10.0230.00815.25
7.1.00.0330.01015.45
7.0.330.0040.00815.28
7.0.320.0030.00615.58
7.0.310.0090.00615.41
7.0.300.0040.01115.20
7.0.290.0070.00715.25
7.0.280.0070.00715.17
7.0.270.0000.01515.44
7.0.260.0120.00615.29
7.0.250.0070.01015.48
7.0.240.0040.00815.49
7.0.230.0090.00015.38
7.0.220.0040.00415.31
7.0.210.0030.01015.60
7.0.200.0030.01015.57
7.0.190.0030.00715.42
7.0.180.0000.00915.20
7.0.170.0060.00615.51
7.0.160.0110.00015.40
7.0.150.0120.00015.20
7.0.140.0050.00515.27
7.0.130.0030.01015.52
7.0.120.0060.00815.59
7.0.110.0090.00315.07
7.0.100.0070.00315.23
7.0.90.0080.00015.30
7.0.80.0040.00815.34
7.0.70.0030.00615.18
7.0.60.0070.00715.19
7.0.50.0140.00015.28
7.0.40.0000.00913.39
7.0.30.0060.00913.68
7.0.20.0030.01013.43
7.0.10.0070.00713.19
7.0.00.0070.00713.59
5.6.400.0040.00814.38
5.6.390.0070.01014.21
5.6.380.0050.00714.36
5.6.370.0030.01014.50
5.6.360.0060.00614.18
5.6.350.0100.00314.26
5.6.340.0040.01114.38
5.6.330.0000.01114.14
5.6.320.0090.00414.30
5.6.310.0100.00014.21
5.6.300.0030.00914.32
5.6.290.0040.01114.38
5.6.280.0030.00914.32
5.6.270.0030.00614.34
5.6.260.0080.00414.19
5.6.250.0060.01014.35
5.6.240.0000.01114.17
5.6.230.0070.00714.18
5.6.220.0040.00814.13
5.6.210.0130.00314.24
5.6.200.0030.00614.14
5.6.190.0030.01414.20
5.6.180.0030.01414.05
5.6.170.0090.00614.25
5.6.160.0090.00613.96
5.6.150.0100.00014.21
5.6.140.0080.00414.04
5.6.130.0060.00914.19
5.6.120.0140.00013.91
5.6.110.0070.01014.29
5.6.100.0100.00313.93
5.6.90.0100.00614.23
5.6.80.0090.00914.18
5.6.70.0100.00714.03
5.6.60.0000.01314.14
5.6.50.0060.00914.02
5.6.40.0100.00313.84
5.6.30.0070.00714.17
5.6.20.0060.00913.91
5.6.10.0130.00313.86
5.6.00.0030.00714.08

preferences:
70.65 ms | 401 KiB | 5 Q