3v4l.org

run code in 300+ PHP versions simultaneously
<?php $val = 12; $bin_val = 1 << ($val -1); var_dump($bin_val); var_dump(pow(2, $val - 1)); $val = 1 >> ($val - 1); var_dump($val); $binary_string = decbin($bin_val ); // This command test the string with binary values, returning an array with the positions where we have '1'. $positions = StringHelper::strPosAll(strrev($binary_string), '1'); if (is_array($positions)) { // We have to add 1 position to fix the "starts with 0 of arrays". foreach ($positions as $key => $value) { $positions[$key] = ($value + 1); } } else { $positions = array(); } var_dump($positions);

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.40.0040.01118.64
8.3.30.0100.00319.02
8.3.20.0000.00720.23
8.3.10.0050.00320.61
8.3.00.0080.00019.25
8.2.170.0090.00622.96
8.2.160.0120.00320.39
8.2.150.0040.00424.18
8.2.140.0070.00024.66
8.2.130.0060.00326.16
8.2.120.0040.00422.19
8.2.110.0030.00620.94
8.2.100.0090.00317.78
8.2.90.0080.00019.04
8.2.80.0050.00317.97
8.2.70.0090.00017.63
8.2.60.0000.00817.91
8.2.50.0030.00618.07
8.2.40.0040.00418.03
8.2.30.0050.00219.32
8.2.20.0000.00817.65
8.2.10.0040.00418.12
8.2.00.0040.00417.62
8.1.270.0090.00922.01
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0000.01022.81
8.1.230.0060.00622.25
8.1.220.0070.00017.80
8.1.210.0030.00718.77
8.1.200.0060.00617.35
8.1.190.0030.00617.23
8.1.180.0000.00818.10
8.1.170.0030.00518.36
8.1.160.0040.00421.96
8.1.150.0000.00718.73
8.1.140.0070.00017.42
8.1.130.0000.00717.76
8.1.120.0070.00017.32
8.1.110.0040.00317.39
8.1.100.0000.00717.42
8.1.90.0040.00417.33
8.1.80.0000.00717.35
8.1.70.0030.00317.31
8.1.60.0050.00317.61
8.1.50.0090.00017.54
8.1.40.0040.00417.51
8.1.30.0060.00317.64
8.1.20.0060.00317.67
8.1.10.0030.00517.54
8.1.00.0050.00317.50
8.0.300.0000.00718.77
8.0.290.0020.00516.75
8.0.280.0000.00718.39
8.0.270.0040.00417.27
8.0.260.0030.00317.26
8.0.250.0000.00716.97
8.0.240.0030.00317.01
8.0.230.0040.00417.00
8.0.220.0040.00416.75
8.0.210.0000.00716.96
8.0.200.0000.00816.94
8.0.190.0050.00216.94
8.0.180.0070.00016.82
8.0.170.0000.00716.93
8.0.160.0050.00216.92
8.0.150.0000.00716.82
8.0.140.0000.00716.84
8.0.130.0030.00313.32
8.0.120.0040.00416.75
8.0.110.0070.00016.91
8.0.100.0000.00716.95
8.0.90.0050.00216.93
8.0.80.0100.01216.91
8.0.70.0000.00716.79
8.0.60.0080.00016.77
8.0.50.0040.00416.71
8.0.30.0110.00816.94
8.0.20.0110.00917.40
8.0.10.0000.00716.91
8.0.00.0060.01216.80
7.4.330.0050.00015.00
7.4.320.0000.00616.57
7.4.300.0060.00016.58
7.4.290.0000.01016.51
7.4.280.0040.00416.61
7.4.270.0080.00016.65
7.4.260.0000.00716.36
7.4.250.0050.00216.42
7.4.240.0020.00516.56
7.4.230.0070.00016.63
7.4.220.0100.01016.59
7.4.210.0140.00716.61
7.4.200.0070.00016.67
7.4.160.0090.00616.59
7.4.150.0000.01717.40
7.4.140.0070.01217.86
7.4.130.0140.00616.55
7.4.120.0070.01016.63
7.4.110.0060.01216.57
7.4.100.0030.01516.50
7.4.90.0140.00316.40
7.4.80.0130.01018.80
7.4.70.0150.00316.60
7.4.60.0060.00916.40
7.4.50.0040.00416.16
7.4.40.0090.01216.70
7.4.30.0100.00716.59
7.4.00.0030.00514.96
7.3.330.0000.00613.21
7.3.320.0050.00013.21
7.3.310.0040.00416.26
7.3.300.0040.00416.31
7.3.290.0070.00716.29
7.3.280.0090.00616.27
7.3.270.0130.00517.40
7.3.260.0130.00616.33
7.3.250.0080.00916.51
7.3.240.0150.00316.46
7.3.230.0070.01016.42
7.3.210.0060.01116.34
7.3.200.0040.01319.39
7.3.190.0060.01316.29
7.3.180.0120.00316.54
7.3.170.0130.01016.39
7.3.160.0110.00416.58
7.2.330.0100.00716.71
7.2.320.0060.01216.71
7.2.310.0090.00916.65
7.2.300.0090.00916.63
7.2.290.0170.00516.64
7.2.60.0060.01016.55
7.2.00.0000.01219.41
7.1.200.0110.00315.90
7.1.100.0030.00617.99
7.1.70.0100.00717.02
7.1.60.0060.01519.32
7.1.50.0030.02216.87
7.1.00.0070.07322.30
7.0.200.0050.00516.80
7.0.140.0070.07022.01
7.0.60.0030.08719.95
7.0.50.0200.06717.92
7.0.40.0230.07720.20
7.0.30.0130.05020.17
7.0.20.0370.05020.02
7.0.10.0070.08020.16
7.0.00.0100.04020.28
5.6.280.0070.07021.07
5.6.210.0070.07720.51
5.6.200.0070.08018.19
5.6.190.0000.09320.68
5.6.180.3430.04720.54
5.6.170.0270.05020.45
5.6.160.0070.03720.46
5.6.150.0070.06318.18
5.6.140.0030.04018.20
5.6.130.0100.08318.18
5.6.120.0030.08721.01
5.6.110.0000.07020.96
5.6.100.0070.08721.02
5.6.90.0100.07020.98
5.6.80.0130.07720.35
5.6.70.4500.04020.39
5.5.350.0000.08720.43
5.5.340.0070.08317.89
5.5.330.0030.06320.21
5.5.320.0230.03720.29
5.5.310.0300.07020.23
5.5.300.0030.08317.90
5.5.290.0030.05717.87
5.5.280.0100.05320.84
5.5.270.0070.03720.76
5.5.260.0100.08020.87
5.5.250.0070.08020.56
5.5.240.0130.04320.16
5.4.450.0230.04319.39
5.4.440.0100.04719.50
5.4.430.0230.08319.38
5.4.420.0170.04019.54
5.4.410.0300.06319.30
5.4.400.0200.05019.25
5.4.390.0400.07019.04
5.4.380.0130.04019.09
5.4.370.0170.05319.24
5.4.360.0130.08718.78
5.4.350.0230.04019.12
5.4.340.0330.06318.77
5.4.320.0130.04019.09
5.4.310.0230.05018.81
5.4.300.0100.05019.09
5.4.290.0300.03318.91
5.4.280.0300.06718.79
5.4.270.0230.06018.93
5.4.260.0300.05719.09
5.4.250.0200.04318.93
5.4.240.0230.05718.88
5.4.230.0130.04018.88
5.4.220.0270.04018.92
5.4.210.0270.07018.93
5.4.200.0130.04019.08
5.4.190.0270.06019.12
5.4.180.0230.07019.22
5.4.170.0200.06719.22
5.4.160.0300.05319.13
5.4.150.0230.05019.07
5.4.140.0170.04316.43
5.4.130.0100.04316.16
5.4.120.0200.07016.27
5.4.110.0230.03316.41
5.4.100.0130.05316.38
5.4.90.0200.04316.31
5.4.80.0200.06016.41
5.4.70.0200.04316.29
5.4.60.0230.04016.44
5.4.50.0270.05316.45
5.4.40.0200.04016.28
5.4.30.0230.07716.43
5.4.20.0230.05316.16
5.4.10.0230.05716.45
5.4.00.0200.06715.97
5.3.290.0230.05014.75
5.3.280.0200.05014.45
5.3.270.0170.05714.46
5.3.260.0230.04314.44
5.3.250.0230.07014.55
5.3.240.0230.07714.46
5.3.230.0200.07014.45
5.3.220.0170.07014.44
5.3.210.0270.05014.40
5.3.200.0270.06714.52
5.3.190.0200.04014.44
5.3.180.0230.05714.58
5.3.170.0230.03714.40
5.3.160.0200.07014.54
5.3.150.0200.05314.51
5.3.140.0230.04014.41
5.3.130.0200.04314.64
5.3.120.0170.04314.52
5.3.110.0270.03714.40
5.3.100.0200.07014.00
5.3.90.0170.04014.00
5.3.80.0300.03313.85
5.3.70.0100.06714.04
5.3.60.0230.03714.02
5.3.50.0200.07313.89
5.3.40.0230.06013.99
5.3.30.0100.05713.74
5.3.20.0130.04013.63
5.3.10.0170.07013.45
5.3.00.0230.05713.69
5.2.170.0200.06011.01
5.2.160.0200.03011.04
5.2.150.0230.04311.05
5.2.140.0170.03310.99
5.2.130.0230.06710.96
5.2.120.0130.04010.99
5.2.110.0200.03010.99
5.2.100.0170.03310.95
5.2.90.0200.04310.94
5.2.80.0170.02710.93
5.2.70.0170.06011.14
5.2.60.0030.02710.98
5.2.50.0030.03010.97
5.2.40.0170.02310.86
5.2.30.0130.03010.91
5.2.20.0100.03010.84
5.2.10.0100.03010.96
5.2.00.0130.03310.68
5.1.60.0030.04310.00
5.1.50.0100.0379.97
5.1.40.0170.0309.99
5.1.30.0170.05010.29
5.1.20.0130.03710.37
5.1.10.0130.0279.96
5.1.00.0200.0509.96
5.0.50.0070.0238.54
5.0.40.0070.0478.32
5.0.30.0070.0308.28
5.0.20.0070.0178.08
5.0.10.0030.0278.16
5.0.00.0130.0578.10
4.4.90.0070.0177.87
4.4.80.0070.0207.87
4.4.70.0170.0237.87
4.4.60.0100.0307.87
4.4.50.0070.0177.87
4.4.40.0070.0307.87
4.4.30.0100.0177.87
4.4.20.0070.0207.87
4.4.10.0070.0207.87
4.4.00.0070.0237.87
4.3.110.0130.0207.87
4.3.100.0030.0177.87
4.3.90.0070.0237.87
4.3.80.0030.0277.87
4.3.70.0070.0137.87
4.3.60.0100.0107.87
4.3.50.0100.0237.87
4.3.40.0070.0437.87
4.3.30.0030.0177.87
4.3.20.0030.0207.87
4.3.10.0000.0177.87
4.3.00.0030.0207.87

preferences:
46.57 ms | 400 KiB | 5 Q