3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = ['x', 'y', 'z']; $mask = 5; $count = count($arr); $mask &= pow(2, $count) - 1; $offset = $count - 1; $result = []; foreach ($arr as $k => $v) { var_dump($offset, $k); if ($mask >> ($offset - $k)) { $result[] = $v; } } var_dump($result);

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.0050.01018.51
8.3.30.0070.00719.04
8.3.20.0000.00820.21
8.3.10.0050.00321.80
8.3.00.0120.00617.80
8.2.170.0060.00922.96
8.2.160.0070.00720.52
8.2.150.0040.00424.18
8.2.140.0030.00524.66
8.2.130.0000.00826.16
8.2.120.0080.00021.01
8.2.110.0030.00622.20
8.2.100.0090.00320.54
8.2.90.0030.00519.35
8.2.80.0040.00417.97
8.2.70.0000.00817.63
8.2.60.0040.00417.93
8.2.50.0030.00618.07
8.2.40.0050.00218.34
8.2.30.0030.00718.29
8.2.20.0080.00017.67
8.2.10.0000.00718.01
8.2.00.0030.00517.72
8.1.270.0080.00023.85
8.1.260.0090.00026.35
8.1.250.0040.00428.09
8.1.240.0100.00021.98
8.1.230.0030.00719.16
8.1.220.0090.00017.74
8.1.210.0060.00318.77
8.1.200.0000.00917.22
8.1.190.0040.00417.13
8.1.180.0030.00518.10
8.1.170.0040.00418.65
8.1.160.0030.00522.00
8.1.150.0040.00418.85
8.1.140.0050.00217.36
8.1.130.0070.00017.82
8.1.120.0050.00317.35
8.1.110.0000.00817.37
8.1.100.0000.00717.41
8.1.90.0070.00317.48
8.1.80.0000.00817.49
8.1.70.0000.00717.42
8.1.60.0060.00317.46
8.1.50.0060.00317.43
8.1.40.0080.00017.41
8.1.30.0050.00317.47
8.1.20.0000.00917.63
8.1.10.0040.00417.46
8.1.00.0030.00617.41
8.0.300.0000.00718.77
8.0.290.0070.00016.63
8.0.280.0000.00718.47
8.0.270.0000.00717.19
8.0.260.0030.00317.31
8.0.250.0030.00316.88
8.0.240.0030.00516.99
8.0.230.0000.00716.84
8.0.220.0030.00316.79
8.0.210.0040.00416.79
8.0.200.0030.00316.98
8.0.190.0030.00516.89
8.0.180.0000.00716.92
8.0.170.0000.00816.83
8.0.160.0030.00316.84
8.0.150.0020.00516.87
8.0.140.0040.00416.73
8.0.130.0050.00013.30
8.0.120.0070.00016.87
8.0.110.0040.00416.71
8.0.100.0050.00216.77
8.0.90.0070.00016.71
8.0.80.0000.01516.84
8.0.70.0040.00416.75
8.0.60.0000.00716.75
8.0.50.0000.00716.90
8.0.30.0110.01217.16
8.0.20.0100.01017.40
8.0.10.0000.00816.86
8.0.00.0090.00816.81
7.4.330.0030.00315.09
7.4.320.0030.00316.49
7.4.300.0060.00016.49
7.4.290.0040.00416.42
7.4.280.0000.00716.48
7.4.270.0000.00716.60
7.4.260.0000.00716.47
7.4.250.0040.00416.38
7.4.240.0070.00016.59
7.4.230.0000.00716.70
7.4.220.0060.01016.55
7.4.210.0110.00316.61
7.4.200.0070.00016.29
7.4.160.0090.00916.55
7.4.150.0120.00617.40
7.4.140.0170.00017.86
7.4.130.0110.00516.35
7.4.120.0060.01116.48
7.4.110.0030.01416.68
7.4.100.0160.00016.44
7.4.90.0220.00016.48
7.4.80.0080.01719.39
7.4.70.0030.01316.43
7.4.60.0120.00616.44
7.4.50.0000.00716.55
7.4.40.0090.00916.57
7.4.30.0090.00616.39
7.4.00.0080.00814.94
7.3.330.0000.00713.18
7.3.320.0000.00613.09
7.3.310.0030.00316.25
7.3.300.0060.00016.25
7.3.290.0110.00316.30
7.3.280.0070.00916.28
7.3.270.0100.00817.40
7.3.260.0120.01116.30
7.3.250.0110.00816.32
7.3.240.0070.01116.37
7.3.230.0140.00616.64
7.3.210.0140.00316.61
7.3.200.0130.01019.39
7.3.190.0070.01016.24
7.3.180.0090.00616.49
7.3.170.0150.00416.53
7.3.160.0000.01616.39
7.3.120.0030.01515.05
7.3.110.0070.01214.88
7.3.100.0080.00815.08
7.3.90.0070.00714.84
7.3.80.0030.00914.79
7.3.70.0050.00914.95
7.3.60.0090.00414.85
7.3.50.0040.01114.83
7.3.40.0050.00614.75
7.3.30.0060.00614.78
7.3.20.0060.00616.74
7.3.10.0030.00916.59
7.3.00.0050.01016.70
7.2.330.0150.00816.52
7.2.320.0110.01116.51
7.2.310.0170.00016.48
7.2.300.0070.02216.61
7.2.290.0130.00316.79
7.2.250.0070.01314.95
7.2.240.0120.00715.23
7.2.230.0070.00815.17
7.2.220.0000.01315.01
7.2.210.0100.00514.91
7.2.200.0050.00914.98
7.2.190.0030.01115.15
7.2.180.0050.00915.11
7.2.170.0090.00314.91
7.2.160.0060.00814.93
7.2.150.0070.00816.85
7.2.140.0070.00716.91
7.2.130.0070.00716.79
7.2.120.0100.00816.87
7.2.110.0060.00516.97
7.2.100.0110.00516.78
7.2.90.0030.01216.88
7.2.80.0000.01516.90
7.2.70.0050.01117.04
7.2.60.0070.00516.96
7.2.50.0050.00716.80
7.2.40.0060.00616.79
7.2.30.0080.00816.81
7.2.20.0050.00716.89
7.2.10.0030.01016.71
7.2.00.0070.00717.75
7.1.330.0080.00815.87
7.1.320.0050.01015.84
7.1.310.0050.00815.92
7.1.300.0020.00915.75
7.1.290.0030.00915.76
7.1.280.0020.00815.75
7.1.270.0030.00815.62
7.1.260.0060.00715.69
7.1.250.0050.00915.88
7.1.240.0080.00415.87
7.1.230.0040.00815.70
7.1.220.0030.00915.68
7.1.210.0030.00715.79
7.1.200.0030.00515.75
7.1.190.0070.00715.89
7.1.180.0000.00815.79
7.1.170.0000.01115.68
7.1.160.0000.01415.83
7.1.150.0040.01115.71
7.1.140.0060.00615.82
7.1.130.0000.01515.90
7.1.120.0070.00415.75
7.1.110.0130.00015.80
7.1.100.0020.00916.80
7.1.90.0030.00915.79
7.1.80.0030.00915.88
7.1.70.0080.00216.41
7.1.60.0100.01017.58
7.1.50.0070.01016.30
7.1.40.0090.00615.71
7.1.30.0070.00715.83
7.1.20.0090.00615.86
7.1.10.0030.01015.68
7.1.00.0050.04019.12
7.0.330.0060.00315.57
7.0.320.0040.00415.53
7.0.310.0070.00715.40
7.0.300.0060.00915.16
7.0.290.0060.00315.43
7.0.280.0030.00715.45
7.0.270.0060.00315.35
7.0.260.0090.00615.50
7.0.250.0080.00815.32
7.0.240.0060.00915.19
7.0.230.0060.00615.51
7.0.220.0030.00615.69
7.0.210.0040.00415.40
7.0.200.0540.00615.26
7.0.190.0060.00615.45
7.0.180.0060.00315.29
7.0.170.0060.00315.33
7.0.160.0040.00715.32
7.0.150.0030.00615.47
7.0.140.0020.04318.65
7.0.130.0070.01015.63
7.0.120.0070.00715.56
7.0.110.0000.00915.47
7.0.100.0000.00915.52
7.0.90.0030.01015.38
7.0.80.0080.00515.30
7.0.70.0060.00915.36
7.0.60.0100.04517.65
7.0.50.0030.03016.67
7.0.40.0070.03016.82
7.0.30.0300.03916.88
7.0.20.0170.04016.78
7.0.10.0070.04516.85
7.0.00.0050.02516.85
5.6.400.0000.01114.60
5.6.390.0060.00814.43
5.6.380.0040.01114.43
5.6.370.0040.01114.59
5.6.360.0030.01214.41
5.6.350.0030.01014.82
5.6.340.0030.01014.51
5.6.330.0070.00314.76
5.6.320.0030.00714.52
5.6.310.0040.00814.74
5.6.300.0030.00914.39
5.6.290.0140.00014.45
5.6.280.0070.03717.76
5.6.270.0040.01214.52
5.6.260.0000.01014.50
5.6.250.0130.00314.49
5.6.240.0030.01014.45
5.6.230.0080.00614.41
5.6.220.0040.01114.33
5.6.210.0080.03117.61
5.6.200.0030.03816.27
5.6.190.0020.03417.63
5.6.180.0120.03017.54
5.6.170.0150.04217.52
5.6.160.0070.03517.37
5.6.150.0150.03716.40
5.6.140.0050.04116.30
5.6.130.0090.03716.23
5.6.120.0130.04317.72
5.6.110.0120.04317.56
5.6.100.0070.04517.74
5.6.90.0050.04917.63
5.6.80.0060.04617.37
5.6.70.0000.01114.43
5.6.60.0060.00314.28
5.6.50.0090.00614.14
5.6.40.0030.01014.39
5.6.30.0090.00614.32
5.6.20.0000.01314.65
5.6.10.0040.01114.30
5.6.00.0040.00414.36
5.5.380.0030.01014.21
5.5.370.0060.00914.60
5.5.360.0030.01314.34
5.5.350.0180.04217.29
5.5.340.0020.02816.10
5.5.330.0070.03217.30
5.5.320.0130.03517.22
5.5.310.0220.04417.55
5.5.300.0030.02716.09
5.5.290.0050.04716.35
5.5.280.0050.03917.60
5.5.270.0050.03617.59
5.5.260.0100.02917.49
5.5.250.0110.03517.38
5.5.240.0050.02317.10
5.5.230.0030.01414.37
5.5.220.0070.00714.29
5.5.210.0050.00514.60
5.5.200.0070.00714.21
5.5.190.0060.00914.39
5.5.180.0060.00614.50
5.5.170.0030.00514.38
5.5.160.0100.00314.36
5.5.150.0030.01014.21
5.5.140.0000.01414.43
5.5.130.0060.00614.48
5.5.120.0060.00614.52
5.5.110.0070.00714.44
5.5.100.0030.00914.21
5.5.90.0060.00614.18
5.5.80.0040.00714.28
5.5.70.0040.00814.30
5.5.60.0090.00414.39
5.5.50.0030.01214.30
5.5.40.0060.00614.47
5.5.30.0060.00914.48
5.5.20.0040.01114.34
5.5.10.0000.01014.21
5.5.00.0090.00614.26
5.4.450.0430.03015.23
5.4.440.0500.02815.27
5.4.430.0550.03615.05
5.4.420.0550.02815.07
5.4.410.0080.02815.04
5.4.400.0200.02615.01
5.4.390.0230.03114.75
5.4.380.0150.02715.03
5.4.370.0170.02714.98
5.4.360.0030.02614.84
5.4.350.0030.02211.63
5.4.340.0040.02111.46
5.4.330.0000.00810.98
5.4.320.0050.02111.81
5.4.310.0050.02011.82
5.4.300.0030.02211.76
5.4.290.0040.02111.91
5.4.280.0060.02211.62
5.4.270.0060.02411.68
5.4.260.0030.02411.68
5.4.250.0050.02311.74
5.4.240.0060.02011.72
5.4.230.0040.02311.66
5.4.220.0040.02311.57
5.4.210.0080.01911.80
5.4.200.0050.02511.66
5.4.190.0040.02311.70
5.4.180.0060.02311.66
5.4.170.0080.02611.77
5.4.160.0070.01911.74
5.4.150.0030.02211.56
5.4.140.0030.02411.53
5.4.130.0040.02211.44
5.4.120.0020.02511.46
5.4.110.0070.01911.64
5.4.100.0070.02011.52
5.4.90.0060.02111.50
5.4.80.0090.01811.58
5.4.70.0050.02111.57
5.4.60.0040.02311.54
5.4.50.0050.01911.50
5.4.40.0020.02311.63
5.4.30.0050.02211.53
5.4.20.0070.01911.46
5.4.10.0030.02311.53
5.4.00.0030.02111.23
5.3.290.0070.02111.67
5.3.280.0060.02211.63
5.3.270.0020.02411.64
5.3.260.0050.02111.63
5.3.250.0020.02411.63
5.3.240.0030.02911.63
5.3.230.0060.02111.63
5.3.220.0050.02311.61
5.3.210.0040.02411.62
5.3.200.0040.02211.62
5.3.190.0020.02311.61
5.3.180.0050.02211.61
5.3.170.0070.02011.61
5.3.160.0050.02011.61
5.3.150.0040.02311.61
5.3.140.0020.02211.61
5.3.130.0050.02311.60
5.3.120.0070.02211.60
5.3.110.0050.02011.60
5.3.100.0050.02111.33
5.3.90.0020.02411.31
5.3.80.0060.02511.31
5.3.70.0080.02311.31
5.3.60.0050.02411.30
5.3.50.0050.01911.27
5.3.40.0050.01811.27
5.3.30.0070.01911.25
5.3.20.0080.01811.14
5.3.10.0040.02011.12
5.3.00.0070.02011.11
5.2.170.0040.0319.18
5.2.160.0050.0339.18
5.2.150.0060.0409.18
5.2.140.0020.0399.18
5.2.130.0060.0279.14
5.2.120.0070.0379.14
5.2.110.0050.0299.15
5.2.100.0050.0279.14
5.2.90.0050.0289.14
5.2.80.0050.0299.14
5.2.70.0030.0329.14
5.2.60.0030.0329.09
5.2.50.0060.0289.05
5.2.40.0090.0319.03
5.2.30.0050.0309.01
5.2.20.0070.0279.01
5.2.10.0030.0378.92
5.2.00.0060.0408.79
5.1.60.0080.0298.06
5.1.50.0080.0218.06
5.1.40.0060.0228.05
5.1.30.0060.0258.40
5.1.20.0050.0268.42
5.1.10.0050.0258.14
5.1.00.0050.0258.14
5.0.50.0050.0196.62
5.0.40.0030.0206.48
5.0.30.0020.0326.29
5.0.20.0030.0196.27
5.0.10.0030.0206.24
5.0.00.0020.0326.23
4.4.90.0040.0144.78
4.4.80.0010.0164.75
4.4.70.0050.0134.75
4.4.60.0040.0144.75
4.4.50.0040.0144.77
4.4.40.0030.0254.71
4.4.30.0020.0174.76
4.4.20.0020.0164.84
4.4.10.0010.0174.85
4.4.00.0030.0254.76
4.3.110.0040.0214.67
4.3.100.0050.0144.66
4.3.90.0030.0164.63
4.3.80.0010.0264.58
4.3.70.0030.0144.63
4.3.60.0020.0194.63
4.3.50.0030.0154.62
4.3.40.0030.0244.53
4.3.30.0020.0163.28
4.3.20.0020.0163.26
4.3.10.0030.0153.22
4.3.00.0070.0277.21

preferences:
44.7 ms | 400 KiB | 5 Q