3v4l.org

run code in 300+ PHP versions simultaneously
<?php function bit2chr_mask(string $flags, int $bitmask): string { $chrmask = ''; for($bit = 1, $i = 0; $bit < $bitmask; $bit <<= 1, $i++) { if($bitmask & $bit){ $chrmask .= $flags[$i]; } } return $chrmask; } var_dump(bit2chr_mask('abcdefg', 2147483648));

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.0130.00316.50
8.3.50.0100.00616.39
8.3.40.0150.00018.59
8.3.30.0070.01018.71
8.3.20.0070.01021.70
8.3.10.0040.00423.61
8.3.00.0040.00422.09
8.2.180.0190.00016.88
8.2.170.0110.00322.96
8.2.160.0070.00720.53
8.2.150.0050.00224.18
8.2.140.0000.00724.66
8.2.130.0080.00020.93
8.2.120.0090.00626.35
8.2.110.0040.00419.39
8.2.100.0080.00417.91
8.2.90.0000.00917.84
8.2.80.0090.00019.02
8.2.70.0050.00318.02
8.2.60.0030.00617.50
8.2.50.0040.00418.10
8.2.40.0070.00020.55
8.2.30.0030.00522.41
8.2.20.0040.00418.06
8.2.10.0070.00017.95
8.2.00.0080.00017.97
8.1.280.0140.00025.92
8.1.270.0070.00023.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0090.00022.10
8.1.230.0030.00920.97
8.1.220.0000.00817.74
8.1.210.0030.00618.96
8.1.200.0000.00817.10
8.1.190.0050.00317.13
8.1.180.0060.00318.10
8.1.170.0000.00818.54
8.1.160.0040.00418.76
8.1.150.0030.00320.21
8.1.140.0020.00519.29
8.1.130.0000.00719.07
8.1.120.0000.00817.42
8.1.110.0040.00417.38
8.1.100.0000.00817.30
8.1.90.0050.00317.30
8.1.80.0050.00317.39
8.1.70.0000.00817.42
8.1.60.0000.00817.60
8.1.50.0000.00817.53
8.1.40.0040.00417.55
8.1.30.0030.00517.58
8.1.20.0000.00717.62
8.1.10.0040.00417.57
8.1.00.0030.00617.43
8.0.300.0030.00320.08
8.0.290.0030.00616.63
8.0.280.0000.00718.40
8.0.270.0000.00717.11
8.0.260.0050.00316.70
8.0.250.0030.00316.80
8.0.240.0000.00716.82
8.0.230.0000.00716.84
8.0.220.0000.00716.89
8.0.210.0000.00716.80
8.0.200.0030.00316.95
8.0.190.0080.00016.94
8.0.180.0040.00416.75
8.0.170.0080.00016.75
8.0.160.0040.00416.87
8.0.150.0000.00816.89
8.0.140.0000.00816.82
8.0.130.0020.00513.34
8.0.120.0000.00916.67
8.0.110.0040.00416.87
8.0.100.0000.00716.86
8.0.90.0000.00716.88
8.0.80.0030.01416.80
8.0.70.0000.00716.64
8.0.60.0040.00416.96
8.0.50.0070.00016.66
8.0.30.0100.00816.97
8.0.20.0020.01717.40
8.0.10.0060.00316.80
8.0.00.0130.00816.77
7.4.330.0030.00315.55
7.4.320.0000.00616.50
7.4.300.0060.00016.53
7.4.290.0030.00516.51
7.4.280.0050.00316.59
7.4.270.0030.00316.62
7.4.260.0030.00316.52
7.4.250.0040.00416.63
7.4.240.0070.00016.61
7.4.230.0030.00316.36
7.4.220.0000.00716.36
7.4.210.0100.00816.63
7.4.200.0000.00716.52
7.4.160.0080.00816.50
7.4.140.0120.00717.86
7.4.130.0090.00816.53
7.4.120.0090.00916.60
7.4.110.0070.01116.56
7.4.100.0090.01216.44
7.4.90.0110.00716.36
7.4.80.0120.01219.39
7.4.70.0120.00616.39
7.4.60.0100.00716.43
7.4.50.0030.01016.21
7.4.40.0110.00416.54
7.4.00.0070.00914.81
7.3.330.0040.00413.18
7.3.320.0000.00513.35
7.3.310.0000.00716.31
7.3.300.0030.00316.29
7.3.290.0030.00316.14
7.3.280.0130.00616.28
7.3.260.0080.01216.46
7.3.240.0080.00816.47
7.3.230.0060.01116.37
7.3.210.0100.00716.42
7.3.200.0100.00716.28
7.3.190.0100.00516.58
7.3.180.0130.00916.25
7.3.170.0120.00916.46
7.3.160.0090.00916.28
7.3.120.0100.01014.64
7.3.110.0060.01214.67
7.3.100.0030.01014.60
7.3.90.0070.00714.82
7.3.80.0000.01414.78
7.3.70.0090.00614.66
7.3.60.0090.00314.65
7.3.50.0060.00914.67
7.3.40.0030.01414.55
7.3.30.0130.00314.78
7.3.20.0070.00716.85
7.3.10.0000.01016.73
7.3.00.0040.01116.56
7.2.330.0000.01716.81
7.2.320.0070.01016.72
7.2.310.0080.00816.78
7.2.300.0030.01716.56
7.2.290.0040.01316.64
7.2.250.0150.00314.93
7.2.240.0070.01014.60
7.2.230.0060.00914.95
7.2.220.0030.00914.84
7.2.210.0130.00314.96
7.2.200.0130.00314.81
7.2.190.0090.00614.88
7.2.180.0030.01015.01
7.2.170.0080.00515.02
7.2.60.0080.00416.68
7.2.30.0070.01720.11
7.2.20.0110.01219.92
7.2.10.0100.00819.76
7.2.00.0080.01419.83
7.1.330.0030.01015.62
7.1.320.0000.01115.46
7.1.310.0030.01315.83
7.1.300.0070.00716.00
7.1.290.0030.01215.81
7.1.280.0070.00715.75
7.1.270.0000.01415.77
7.1.260.0110.00315.78
7.1.200.0080.00315.81
7.1.150.0110.01218.54
7.1.140.0060.01218.63
7.1.130.0130.00918.76
7.1.120.0080.01318.33
7.1.110.0120.01017.95
7.1.100.0100.01117.95
7.1.90.0070.01317.99
7.1.80.0090.01318.15
7.1.70.0070.01017.27
7.1.60.0300.02035.09
7.1.50.0330.01334.92
7.1.40.0230.01534.35
7.1.30.0260.01934.21
7.1.20.0280.01434.56
7.1.10.0110.01116.59
7.1.00.0090.01416.66

preferences:
31.07 ms | 400 KiB | 5 Q