3v4l.org

run code in 300+ PHP versions simultaneously
<?php $token_list = str_split("apt71hfmh618k17dgimvltrn06"); $first = null; $second = null; $modified_list = $token_list; for($i = 0; $i < count($token_list); $i++) { if(!is_nan($token_list[$i]) && $i > 4 && $i < count($token_list) -4) { if(is_null($first)) { $first = $i; } } elseif(is_null($second)) { $second = $i; } } if(!is_null($first) && !is_null($second)) { $modified_list[$first] = $token_list[$second]; $modified_list[$second] = $token_list[$first]; } else { $modified_list[12] = $token_list[13]; $modified_list[13] = $token_list[12]; } $modified_token = implode('', $modified_list); var_dump($token_list); var_dump($modified_token);

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.0070.00718.43
8.3.50.0140.00821.87
8.3.40.0070.01418.85
8.3.30.0190.00318.79
8.3.20.0000.00820.16
8.3.10.0120.00623.70
8.3.00.0100.01019.50
8.2.180.0100.01018.34
8.2.170.0090.00922.96
8.2.160.0150.00421.93
8.2.150.0150.00024.18
8.2.140.0100.01024.66
8.2.130.0060.00617.50
8.2.120.0030.01326.35
8.2.110.0060.00321.00
8.2.100.0080.00417.84
8.2.90.0030.00617.84
8.2.80.0050.00318.09
8.2.70.0030.00617.63
8.2.60.0030.00617.93
8.2.50.0080.00018.07
8.2.40.0050.00719.05
8.2.30.0030.00620.52
8.2.20.0000.00917.82
8.2.10.0040.00418.20
8.2.00.0040.00418.18
8.1.280.0080.00825.92
8.1.270.0040.00422.11
8.1.260.0130.00328.09
8.1.250.0100.01028.09
8.1.240.0060.00322.01
8.1.230.0000.01220.79
8.1.220.0090.00017.79
8.1.210.0040.00718.77
8.1.200.0060.00317.35
8.1.190.0050.00217.22
8.1.180.0080.00018.10
8.1.170.0000.00720.21
8.1.160.0040.00421.96
8.1.150.0060.00618.89
8.1.140.0050.00519.46
8.1.130.0070.00017.76
8.1.120.0040.00417.41
8.1.110.0030.00617.46
8.1.100.0040.00417.37
8.1.90.0000.00817.35
8.1.80.0040.00417.47
8.1.70.0000.00717.39
8.1.60.0030.00717.59
8.1.50.0060.00317.58
8.1.40.0040.00417.49
8.1.30.0050.00317.66
8.1.20.0060.00317.60
8.1.10.0050.00317.45
8.1.00.0000.00717.43
8.0.300.0000.00719.95
8.0.290.0050.00216.75
8.0.280.0030.00318.39
8.0.270.0040.00417.25
8.0.260.0070.00017.11
8.0.250.0040.00416.95
8.0.240.0040.00416.92
8.0.230.0050.00216.83
8.0.220.0000.00816.90
8.0.210.0000.00816.88
8.0.200.0000.00716.98
8.0.190.0000.00816.99
8.0.180.0050.00316.90
8.0.170.0050.00317.02
8.0.160.0000.00716.96
8.0.150.0000.00716.82
8.0.140.0040.00416.95
8.0.130.0030.00313.38
8.0.120.0040.00417.01
8.0.110.0070.00016.86
8.0.100.0040.00417.03
8.0.90.0050.00217.08
8.0.80.0060.00916.85
8.0.70.0090.00016.97
8.0.60.0000.00816.87
8.0.50.0070.00016.81
8.0.30.0120.00717.13
8.0.20.0090.01017.43
8.0.10.0070.00016.97
8.0.00.0120.00716.72
7.4.330.0030.00316.79
7.4.320.0030.00316.60
7.4.300.0000.00716.41
7.4.290.0070.00016.52
7.4.280.0040.00416.43
7.4.270.0000.00716.61
7.4.260.0000.00816.52
7.4.250.0030.00516.40
7.4.240.0000.00716.53
7.4.230.0030.00316.71
7.4.220.0110.00716.70
7.4.210.0120.00916.55
7.4.200.0000.00816.63
7.4.160.0170.00016.61
7.4.150.0150.00417.40
7.4.140.0120.01217.86
7.4.130.0110.01116.55
7.4.120.0100.00916.52
7.4.110.0090.00916.39
7.4.100.0120.01216.42
7.4.90.0030.01416.60
7.4.80.0090.01519.39
7.4.70.0090.00916.35
7.4.60.0160.00616.60
7.4.50.0030.01316.48
7.4.40.0090.00916.57
7.4.30.0180.00216.46
7.4.00.0040.00815.18
7.3.330.0050.00013.24
7.3.320.0060.00013.27
7.3.310.0030.00316.37
7.3.300.0040.00416.23
7.3.290.0090.00916.39
7.3.280.0080.00916.37
7.3.270.0040.01517.40
7.3.260.0180.00416.41
7.3.250.0090.00816.36
7.3.240.0100.00716.51
7.3.230.0160.00316.41
7.3.210.0060.01016.54
7.3.200.0100.01016.44
7.3.190.0000.01616.40
7.3.180.0070.00816.44
7.3.170.0110.00716.43
7.3.160.0110.00616.52
7.3.10.0080.00316.51
7.3.00.0050.01016.63
7.2.330.0070.01116.47
7.2.320.0170.00616.59
7.2.310.0090.00616.51
7.2.300.0120.00616.71
7.2.290.0090.00916.87
7.2.130.0150.00616.75
7.2.120.0090.00517.03
7.2.110.0060.00917.08
7.2.100.0090.01016.98
7.2.90.0030.01017.11
7.2.80.0120.00716.93
7.2.70.0060.01316.98
7.2.60.0070.00316.81
7.2.50.0090.00716.98
7.2.40.0070.01017.07
7.2.30.0030.00916.84
7.2.20.0080.00817.11
7.2.10.0080.00816.93
7.2.00.0010.01017.63
7.1.250.0070.00515.59
7.1.200.0090.00615.83
7.1.100.0070.00318.09
7.1.70.0000.00717.10
7.1.60.0110.01119.48
7.1.50.0030.01916.98
7.1.00.0070.07322.57
7.0.200.0110.00716.84
7.0.60.0070.05719.96
7.0.50.0030.04717.81
7.0.40.0000.04720.18
7.0.30.0230.08720.03
7.0.20.0370.07720.18
7.0.10.0100.08320.00
7.0.00.0130.07020.04
5.6.280.0030.06321.14
5.6.210.0030.05720.47
5.6.200.0130.07718.15
5.6.190.0070.04720.47
5.6.180.0170.04020.36
5.6.170.0470.05720.38
5.6.160.0170.07320.46
5.6.150.0170.07318.21
5.6.140.0030.05018.21
5.6.130.0130.07318.09
5.6.120.0030.08720.97
5.6.110.0100.08320.99
5.6.100.0100.05721.13
5.6.90.0070.07721.04
5.6.80.0070.08020.36
5.5.350.4630.04020.30
5.5.340.0070.04717.92
5.5.330.0100.06720.33
5.5.320.0300.05020.32
5.5.310.0400.06720.29
5.5.300.0100.07317.97
5.5.290.0000.04717.92
5.5.280.0130.04720.90
5.5.270.0170.07320.84
5.5.260.0070.08720.80
5.5.250.0030.08020.58
5.5.240.0270.06320.27

preferences:
61.86 ms | 401 KiB | 5 Q