3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyBitmask { const POS_1 = 1; // const POS_2 = 2; // reserved/undefined // const POS_3 = 3; // reserved/undefined const POS_4 = 4; private $b = 0x0000; function setChecked($pos) { if (in_array($pos, (new ReflectionClass($this))->getConstants())) { $this->set($pos); } return $this; } function set($pos) { $this->b |= 1 << ($pos - 1); return $this; } } $b = new MyBitmask(); var_dump($b->setChecked(2)); var_dump($b->set(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.0000.01616.75
8.3.50.0110.00917.44
8.3.40.0110.00418.54
8.3.30.0040.01118.71
8.3.20.0030.00518.69
8.3.10.0090.00018.79
8.3.00.0050.00519.26
8.2.180.0090.00616.48
8.2.170.0040.01122.96
8.2.160.0100.00321.00
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0000.00726.16
8.2.120.0040.00421.00
8.2.110.0030.00722.07
8.2.100.0090.00317.91
8.2.90.0060.00319.08
8.2.80.0060.00317.97
8.2.70.0000.00817.63
8.2.60.0080.00018.04
8.2.50.0080.00018.10
8.2.40.0040.00422.18
8.2.30.0040.00418.00
8.2.20.0000.01017.46
8.2.10.0080.00017.69
8.2.00.0080.00317.59
8.1.280.0110.00325.92
8.1.270.0070.00023.99
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0030.00624.03
8.1.230.0090.00317.82
8.1.220.0000.00717.74
8.1.210.0000.00818.77
8.1.200.0030.00617.23
8.1.190.0050.00317.22
8.1.180.0000.00818.10
8.1.170.0000.00918.49
8.1.160.0000.00722.02
8.1.150.0090.00018.57
8.1.140.0040.00417.40
8.1.130.0040.00417.39
8.1.120.0000.00717.31
8.1.110.0000.00817.30
8.1.100.0070.00017.38
8.1.90.0030.00517.39
8.1.80.0050.00317.31
8.1.70.0030.00317.27
8.1.60.0000.00717.57
8.1.50.0040.00417.50
8.1.40.0000.00817.48
8.1.30.0000.00817.56
8.1.20.0070.00017.50
8.1.10.0000.00817.51
8.1.00.0000.00817.46
8.0.300.0050.00318.77
8.0.290.0000.00716.63
8.0.280.0000.00718.26
8.0.270.0080.00017.88
8.0.260.0030.00316.75
8.0.250.0000.00716.79
8.0.240.0000.00816.90
8.0.230.0030.00316.76
8.0.220.0040.00416.77
8.0.210.0000.00716.70
8.0.200.0060.00016.77
8.0.190.0000.00716.80
8.0.180.0040.00416.84
8.0.170.0050.00316.77
8.0.160.0000.00716.88
8.0.150.0000.00716.66
8.0.140.0000.00816.82
8.0.130.0000.00513.25
8.0.120.0060.00316.78
8.0.110.0040.00416.71
8.0.100.0070.00016.77
8.0.90.0000.00816.73
8.0.80.0090.01216.89
8.0.70.0040.00416.66
8.0.60.0080.00016.64
8.0.50.0090.00016.89
8.0.30.0040.01817.17
8.0.20.0120.00617.02
8.0.10.0040.00417.02
8.0.00.0130.01116.81
7.4.330.0020.00213.00
7.4.320.0060.00016.46
7.4.300.0000.00616.54
7.4.290.0070.00016.65
7.4.280.0080.00016.61
7.4.270.0000.00716.50
7.4.260.0000.00513.20
7.4.250.0030.00616.39
7.4.240.0000.00716.52
7.4.230.0030.00316.58
7.4.220.0090.00916.66
7.4.210.0090.00616.47
7.4.200.0080.00016.49
7.4.190.0000.00716.67
7.4.160.0040.01116.82
7.4.150.0170.00716.41
7.4.140.0120.00617.86
7.4.130.0130.00616.39
7.4.120.0150.00616.55
7.4.110.0120.00916.36
7.4.100.0150.00316.39
7.4.90.0100.00716.64
7.4.80.0030.01319.39
7.4.70.0130.00416.36
7.4.60.0100.00716.54
7.4.50.0030.00616.50
7.4.40.0090.00316.48
7.4.30.0150.00016.38
7.4.00.0070.00715.22
7.3.330.0000.00613.09
7.3.320.0000.00513.34
7.3.310.0070.00016.16
7.3.300.0030.00316.26
7.3.290.0060.01016.29
7.3.280.0110.00716.26
7.3.270.0090.00816.22
7.3.260.0120.00816.43
7.3.240.0040.01416.30
7.3.230.0120.00616.36
7.3.210.0160.00016.39
7.3.200.0060.01316.26
7.3.190.0070.01416.24
7.3.180.0080.00816.32
7.3.170.0120.00916.47
7.3.160.0090.00616.39
7.3.120.0000.01414.97
7.3.10.0040.01116.69
7.3.00.0060.00916.60
7.2.330.0100.01016.58
7.2.320.0000.01716.64
7.2.310.0070.01016.41
7.2.300.0060.01016.52
7.2.290.0070.01316.40
7.2.130.0070.00716.72
7.2.120.0040.01116.65
7.2.110.0040.00716.93
7.2.100.0070.00716.93
7.2.90.0070.00716.62
7.2.80.0100.00316.94
7.2.70.0090.00616.87
7.2.60.0070.00716.68
7.2.50.0060.00616.89
7.2.40.0130.00316.51
7.2.30.0060.00916.68
7.2.20.0040.01116.89
7.2.10.0000.01016.84
7.2.00.0070.00716.97
7.1.250.0030.00815.48
7.1.200.0040.01115.72
7.1.70.0030.00617.19
7.1.60.0100.01319.25
7.1.50.0040.01816.95
7.1.00.0000.08022.41
7.0.200.0300.01016.70
7.0.140.0030.07022.09
7.0.120.0030.07321.96
7.0.60.0130.08321.67
7.0.50.0070.08017.91
7.0.40.0070.04020.29
7.0.30.0230.09020.09
7.0.20.0300.08020.23
7.0.10.0070.04020.16
7.0.00.0070.07720.20
5.6.280.0000.07721.05
5.6.210.0030.04020.77
5.6.200.0100.07018.13
5.6.190.0170.07720.39
5.6.180.0470.04720.50
5.6.170.0270.08020.58
5.6.160.0070.05320.44
5.6.150.0000.04018.27
5.6.140.0000.04318.18
5.6.130.0100.07018.21
5.6.120.0030.08321.00
5.6.110.0130.07720.99
5.6.100.0000.08720.89
5.6.90.0030.08720.95
5.6.80.0030.04020.38
5.5.350.4270.04020.30
5.5.340.0000.04317.95
5.5.330.0030.05020.19
5.5.320.0300.06720.27
5.5.310.0200.03720.37
5.5.300.0100.05318.01
5.5.290.0100.06718.07
5.5.280.0070.08720.86
5.5.270.0000.06720.77
5.5.260.0100.06720.88
5.5.250.0000.08320.69
5.5.240.0100.03720.29
5.4.450.0070.05719.48
5.4.440.0100.07019.56
5.4.430.0070.04719.47
5.4.420.0100.07719.56
5.4.410.0030.04019.12
5.4.400.0030.08019.08
5.4.390.0030.07319.14
5.4.380.0030.04319.08
5.4.370.0030.04719.15
5.4.360.0100.07019.23
5.4.350.0030.06319.16
5.4.340.0130.06719.14
5.4.320.0070.03719.25
5.4.310.0100.07019.23
5.4.300.0030.07019.15
5.4.290.0100.06019.24
5.4.280.0070.07719.11
5.4.270.0100.03719.15
5.4.260.0030.08018.87
5.4.250.0070.05018.96
5.4.240.0030.04019.11
5.4.230.0000.04719.25
5.4.220.0300.02719.11
5.4.210.0130.06319.16
5.4.200.0030.04019.07
5.4.190.0100.05719.14
5.4.180.0070.04719.10
5.4.170.0070.07019.02
5.4.160.0030.08018.97
5.4.150.0000.05319.13
5.4.140.0000.06716.54
5.4.130.0070.06316.36
5.4.120.0030.06716.30
5.4.110.0030.04716.47
5.4.100.0130.06316.50
5.4.90.0070.03316.30
5.4.80.0000.06716.36
5.4.70.0030.03316.41
5.4.60.0030.04316.47
5.4.50.0070.04016.26
5.4.40.0070.03716.38
5.4.30.0070.07016.46
5.4.20.0070.06316.34
5.4.10.0100.05316.32
5.4.00.0100.06715.96
5.3.290.0000.07014.70
5.3.280.0170.04714.64
5.3.270.0070.05014.68
5.3.260.0130.03314.52
5.3.250.0070.05314.60
5.3.240.0070.05014.76
5.3.230.0070.07714.66
5.3.220.0070.05314.57
5.3.210.0070.07714.71
5.3.200.0030.03714.57
5.3.190.0100.07314.61
5.3.180.0130.05014.58
5.3.170.0100.07014.62
5.3.160.0000.05014.61
5.3.150.0100.06014.62
5.3.140.0000.06014.61
5.3.130.0100.05714.56
5.3.120.0030.06314.59
5.3.110.0100.06014.56
5.3.100.0100.06714.07
5.3.90.0070.07314.18
5.3.80.0000.08014.16
5.3.70.0030.07313.91
5.3.60.0070.07014.00
5.3.50.0130.06013.95
5.3.40.0070.04713.95
5.3.30.0030.06013.98
5.3.20.0000.04313.75
5.3.10.0130.03313.70
5.3.00.0000.04313.66
5.2.170.0030.03011.11
5.2.160.0070.05711.18
5.2.150.0070.03011.15
5.2.140.0100.05711.11
5.2.130.0000.06311.12
5.2.120.0030.06311.00
5.2.110.0030.03311.16
5.2.100.0030.05310.99
5.2.90.0000.04011.25
5.2.80.0070.03311.11
5.2.70.0000.04011.05
5.2.60.0070.05311.12
5.2.50.0030.03011.09
5.2.40.0000.03010.94
5.2.30.0000.03010.89
5.2.20.0130.05711.02
5.2.10.0070.04710.87
5.2.00.0070.05310.68
5.1.60.0070.03010.02
5.1.50.0030.05310.02
5.1.40.0000.0279.89
5.1.30.0000.03010.30
5.1.20.0130.04710.39
5.1.10.0070.05010.09
5.1.00.0030.04310.07
5.0.50.0000.0509.73
5.0.40.0070.0409.73
5.0.30.0030.0639.73
5.0.20.0030.0479.73
5.0.10.0070.0379.73
5.0.00.0030.0679.73
4.4.90.0000.0209.73
4.4.80.0000.0209.73
4.4.70.0070.0209.73
4.4.60.0030.0179.73
4.4.50.0070.0309.73
4.4.40.0000.0309.73
4.4.30.0000.0209.73
4.4.20.0000.0209.73
4.4.10.0000.0239.73
4.4.00.0070.0539.73
4.3.110.0030.0379.73
4.3.100.0000.0309.73
4.3.90.0030.0339.73
4.3.80.0130.0209.73
4.3.70.0070.0339.73
4.3.60.0030.0279.73
4.3.50.0030.0279.73
4.3.40.0070.0479.73
4.3.30.0000.0309.73
4.3.20.0000.0209.73
4.3.10.0030.0209.73
4.3.00.0000.0339.73

preferences:
49.55 ms | 401 KiB | 5 Q