3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getCharacter($index) { $chars = "0123456789ABCDEFGHIJKLMOPQRSTUVWabcdefghijklmnopqrstuvw"; $c = ord(substr($chars, $index % strlen($chars))); return ord(substr($chars, ($index << $c) % strlen($chars))); } function main() { $array = array(176, 52, 608, 855); foreach ($array as $value) { echo "$value: " . getCharacter($value) . "\n"; } } main();

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.0090.00916.38
8.3.50.0100.00618.40
8.3.40.0080.00818.51
8.3.30.0040.01118.54
8.3.20.0050.00318.73
8.3.10.0090.00018.73
8.3.00.0180.00419.13
8.2.180.0110.00725.92
8.2.170.0100.00718.84
8.2.160.0120.00322.96
8.2.150.0050.00524.18
8.2.140.0080.00024.66
8.2.130.0030.00526.16
8.2.120.0040.00419.83
8.2.110.0060.00322.11
8.2.100.0120.00017.91
8.2.90.0050.00317.75
8.2.80.0040.00418.61
8.2.70.0040.00417.50
8.2.60.0000.00718.04
8.2.50.0000.00918.04
8.2.40.0050.00319.35
8.2.30.0050.00517.57
8.2.20.0050.00517.61
8.2.10.0030.00519.50
8.2.00.0000.00717.64
8.1.280.0110.00425.92
8.1.270.0080.00023.99
8.1.260.0060.00326.35
8.1.250.0040.00428.09
8.1.240.0090.00022.45
8.1.230.0040.00817.83
8.1.220.0030.00617.78
8.1.210.0040.00418.77
8.1.200.0030.00517.35
8.1.190.0030.00517.23
8.1.180.0040.00418.10
8.1.170.0050.00317.62
8.1.160.0030.00519.02
8.1.150.0040.00418.52
8.1.140.0030.00717.45
8.1.130.0030.00619.17
8.1.120.0040.00417.39
8.1.110.0070.00317.33
8.1.100.0030.00317.54
8.1.90.0000.00717.44
8.1.80.0040.00317.35
8.1.70.0030.00317.34
8.1.60.0000.00717.58
8.1.50.0050.00217.40
8.1.40.0070.00017.52
8.1.30.0070.00217.54
8.1.20.0040.00417.48
8.1.10.0000.00717.51
8.1.00.0040.00417.47
8.0.300.0040.00421.59
8.0.290.0000.00716.75
8.0.280.0000.00718.57
8.0.270.0030.00617.16
8.0.260.0000.00716.78
8.0.250.0030.00616.98
8.0.240.0040.00716.85
8.0.230.0000.00716.87
8.0.220.0060.00316.91
8.0.210.0070.00016.96
8.0.200.0030.00316.99
8.0.190.0000.00816.95
8.0.180.0040.00816.93
8.0.170.0000.00816.99
8.0.160.0040.00416.77
8.0.150.0030.00616.78
8.0.140.0070.00416.84
8.0.130.0060.00013.34
8.0.120.0060.00316.68
8.0.110.0000.00716.92
8.0.100.0070.00016.74
8.0.90.0050.00216.84
8.0.80.0090.01316.88
8.0.70.0040.00416.84
8.0.60.0000.00716.86
8.0.50.0030.00516.89
8.0.30.0150.00417.17
8.0.20.0150.00716.89
8.0.10.0030.00617.03
8.0.00.0070.01016.83
7.4.330.0000.00512.97
7.4.320.0060.00016.46
7.4.300.0030.00316.51
7.4.290.0030.00316.46
7.4.280.0050.00516.43
7.4.270.0000.00716.47
7.4.260.0000.00613.27
7.4.250.0030.00516.59
7.4.240.0000.00716.59
7.4.230.0030.00616.60
7.4.220.0120.01116.49
7.4.210.0040.01116.69
7.4.200.0000.00716.45
7.4.190.0030.00316.55
7.4.160.0090.00616.59
7.4.150.0070.01016.63
7.4.140.0150.01117.86
7.4.130.0030.01616.48
7.4.120.0090.01616.53
7.4.110.0000.01816.52
7.4.100.0030.02016.47
7.4.90.0110.01116.48
7.4.80.0110.00619.39
7.4.70.0080.00816.64
7.4.60.0090.00916.44
7.4.50.0000.00816.33
7.4.40.0090.00616.35
7.4.30.0080.00916.46
7.4.00.0110.00714.59
7.3.330.0060.00013.22
7.3.320.0000.00613.29
7.3.310.0030.00516.35
7.3.300.0040.00416.20
7.3.290.0090.00716.35
7.3.280.0120.00316.24
7.3.270.0130.01016.33
7.3.260.0240.02516.57
7.3.240.0040.01116.43
7.3.230.0080.00816.47
7.3.210.0090.00916.27
7.3.200.0120.00916.59
7.3.190.0080.00816.44
7.3.180.0060.00916.32
7.3.170.0080.00816.52
7.3.160.0140.00316.36
7.3.120.0040.00914.51
7.2.330.0170.00716.48
7.2.320.0060.01016.85
7.2.310.0130.00616.89
7.2.300.0090.00616.51
7.2.290.0140.00716.70
7.2.80.0090.00616.80
7.2.60.0000.01317.07
7.1.200.0060.00615.55
7.1.70.0040.00416.91
7.1.60.0070.01719.21
7.1.50.0110.01417.08
7.1.00.0030.07022.45
7.0.200.0050.00216.91
7.0.140.0100.06721.92
7.0.120.0070.07021.94
7.0.60.0230.08720.04
7.0.50.0100.04017.92
7.0.40.0030.08020.24
7.0.30.0200.04320.09
7.0.20.0270.05020.23
7.0.10.0130.05320.23
7.0.00.0170.08020.32
5.6.280.0000.07721.02
5.6.210.0130.04320.65
5.6.200.0030.06018.29
5.6.190.0030.04720.61
5.6.180.0070.05020.39
5.6.170.0200.04720.47
5.6.160.0070.04018.28
5.6.150.0000.09018.16
5.6.140.0030.04018.24
5.6.130.0070.07718.23
5.6.120.0070.08720.95
5.6.110.0100.08020.99
5.6.100.0100.03721.14
5.6.90.0000.09021.03
5.6.80.0100.08320.54
5.5.350.0100.08320.47
5.5.340.0100.04717.98
5.5.330.0100.06020.37
5.5.320.0130.03720.34
5.5.310.0230.07720.29
5.5.300.0000.05017.97
5.5.290.0030.04718.03
5.5.280.0100.05720.86
5.5.270.0030.08320.87
5.5.260.0000.09320.65
5.5.250.0100.05020.71
5.5.240.0230.07720.11
5.4.450.0070.07319.48
5.4.440.0030.06719.27
5.4.430.0130.06719.61
5.4.420.0030.08019.31
5.4.410.0100.07319.07
5.4.400.0070.06719.08
5.4.390.0130.03019.24
5.4.380.0070.04319.25
5.4.370.0070.03719.20
5.4.360.0030.04719.16
5.4.350.0100.07019.21
5.4.340.0100.07018.88
5.4.320.0070.04019.05
5.4.310.0070.06319.16
5.4.300.0070.07319.12
5.4.290.0070.06318.87
5.4.280.0070.07719.24
5.4.270.0100.06319.14
5.4.260.0100.07718.92
5.4.250.0070.04018.99
5.4.240.0100.05318.84
5.4.230.0030.04019.00
5.4.220.0130.03718.97
5.4.210.0030.08019.11
5.4.200.0070.05019.13
5.4.190.0100.07318.84
5.4.180.0030.07719.20
5.4.170.0030.04318.91
5.4.160.0100.07019.22
5.4.150.0070.04718.95
5.4.140.0000.07016.48
5.4.130.0000.04316.45
5.4.120.0030.07016.43
5.4.110.0030.05316.48
5.4.100.0070.05016.51
5.4.90.0070.04016.44
5.4.80.0170.03016.70
5.4.70.0030.03716.57
5.4.60.0070.03316.25
5.4.50.0000.03716.32
5.4.40.0000.03716.64
5.4.30.0070.03316.34
5.4.20.0030.03316.30
5.4.10.0030.03716.42
5.4.00.0000.03715.80
5.3.290.0100.07014.70
5.3.280.0070.07714.63
5.3.270.0200.03714.66
5.3.260.0030.04014.52
5.3.250.0100.07014.65
5.3.240.0170.04714.61
5.3.230.0070.03714.52
5.3.220.0100.07314.56
5.3.210.0030.04314.71
5.3.200.0130.03014.64
5.3.190.0070.04714.73
5.3.180.0070.04014.45
5.3.170.0300.02314.62
5.3.160.0000.04014.62
5.3.150.0070.03714.62
5.3.140.0070.03314.60
5.3.130.0000.04014.59
5.3.120.0030.04014.56
5.3.110.0030.03714.62
5.3.100.0000.03714.19
5.3.90.0030.03714.05
5.3.80.0000.03714.03
5.3.70.0130.02714.01
5.3.60.0030.03313.98
5.3.50.0030.03313.97
5.3.40.0000.03713.99
5.3.30.0030.03313.91
5.3.20.0000.03713.77
5.3.10.0000.03713.55
5.3.00.0000.03713.70
5.2.170.0200.01711.20
5.2.160.0000.03011.20
5.2.150.0070.02711.10
5.2.140.0030.02711.15
5.2.130.0030.03011.14
5.2.120.0030.03011.27
5.2.110.0030.03011.05
5.2.100.0030.02711.26
5.2.90.0030.02711.16
5.2.80.0070.03011.11
5.2.70.0030.03011.14
5.2.60.0000.03311.05
5.2.50.0070.02311.02
5.2.40.0000.03311.00
5.2.30.0070.02310.97
5.2.20.0030.03010.92
5.2.10.0000.03010.86
5.2.00.0070.02310.69
5.1.60.0000.02310.09
5.1.50.0030.02310.01
5.1.40.0030.02310.03
5.1.30.0030.02310.49
5.1.20.0030.02310.35
5.1.10.0070.02010.09
5.1.00.0030.02310.21
5.0.50.0000.0209.69
5.0.40.0000.0209.69
5.0.30.0000.0409.69
5.0.20.0030.0279.69
5.0.10.0000.0479.69
5.0.00.0000.0509.69
4.4.90.0000.0179.69
4.4.80.0000.0209.69
4.4.70.0030.0139.69
4.4.60.0000.0179.69
4.4.50.0030.0139.69
4.4.40.0000.0239.69
4.4.30.0000.0179.69
4.4.20.0030.0139.69
4.4.10.0000.0139.69
4.4.00.0000.0239.69
4.3.110.0000.0209.69
4.3.100.0000.0209.69
4.3.90.0000.0379.69
4.3.80.0030.0509.69
4.3.70.0030.0239.69
4.3.60.0070.0139.69
4.3.50.0070.0309.69
4.3.40.0000.0439.69
4.3.30.0000.0379.69
4.3.20.0030.0379.69
4.3.10.0030.0379.69
4.3.00.0000.0179.69

preferences:
43.4 ms | 401 KiB | 5 Q