3v4l.org

run code in 300+ PHP versions simultaneously
<?php function replaceString($string) { $array1 = ['mp', 'tm', 'de']; $array2 = ['MAP', 'TM', "DECIMAL"]; $first = substr($string, 0, -2); $last = substr($string, -2); $split = [ 'start' => $first, 'end' => $last, ]; foreach ($array1 as $key => $val) { if ($val == $split[1]) { $word = $split[0].$array2[$key]; return $word; } } } $mystring = "samplemp"; echo replaceString($mystring)."\n";

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.0100.01018.43
8.3.50.0110.00416.71
8.3.40.0060.00818.79
8.3.30.0110.00418.75
8.3.20.0040.00421.77
8.3.10.0040.00423.53
8.3.00.0000.00818.00
8.2.180.0080.00818.43
8.2.170.0140.00422.96
8.2.160.0100.00321.14
8.2.150.0070.00024.18
8.2.140.0070.00024.66
8.2.130.0080.00026.16
8.2.120.0080.00019.66
8.2.110.0070.00419.51
8.2.100.0090.00918.03
8.2.90.0000.00819.89
8.2.80.0060.00318.03
8.2.70.0100.00017.80
8.2.60.0040.00418.05
8.2.50.0000.00818.10
8.2.40.0000.00720.40
8.2.30.0070.00019.38
8.2.20.0070.00017.99
8.2.10.0080.00018.10
8.2.00.0040.00418.02
8.1.280.0150.00325.92
8.1.270.0080.00022.00
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0030.00620.71
8.1.230.0000.01119.16
8.1.220.0050.00317.77
8.1.210.0040.00418.77
8.1.200.0060.00317.22
8.1.190.0080.00017.35
8.1.180.0060.00318.10
8.1.170.0040.00418.50
8.1.160.0040.00418.93
8.1.150.0000.00720.17
8.1.140.0000.00819.48
8.1.130.0070.00018.80
8.1.120.0030.00317.46
8.1.110.0000.00717.34
8.1.100.0050.00217.36
8.1.90.0050.00217.46
8.1.80.0000.00817.44
8.1.70.0070.00317.40
8.1.60.0000.00817.48
8.1.50.0000.00717.42
8.1.40.0040.00417.53
8.1.30.0040.00417.56
8.1.20.0020.00517.67
8.1.10.0000.00817.60
8.1.00.0000.00717.39
8.0.300.0030.00620.17
8.0.290.0000.00816.75
8.0.280.0080.00018.44
8.0.270.0070.00016.83
8.0.260.0040.00418.44
8.0.250.0030.00316.96
8.0.240.0080.00017.03
8.0.230.0070.00317.02
8.0.220.0000.00716.83
8.0.210.0070.00016.96
8.0.200.0000.00716.98
8.0.190.0030.00616.90
8.0.180.0070.00016.96
8.0.170.0040.00416.90
8.0.160.0000.00716.93
8.0.150.0060.00316.81
8.0.140.0030.00316.94
8.0.130.0060.00213.39
8.0.120.0040.00416.82
8.0.110.0070.00016.86
8.0.100.0040.00416.96
8.0.90.0070.00017.06
8.0.80.0110.00416.90
8.0.70.0000.00716.83
8.0.60.0040.00416.98
8.0.50.0070.00016.84
8.0.30.0120.00917.29
8.0.20.0120.00717.40
8.0.10.0040.00416.84
8.0.00.0070.01016.75
7.4.330.0000.00515.55
7.4.320.0040.00416.43
7.4.300.0040.00416.36
7.4.290.0050.00516.54
7.4.280.0030.00516.58
7.4.270.0040.00416.54
7.4.260.0030.00313.29
7.4.250.0000.00716.62
7.4.240.0000.00716.61
7.4.230.0050.00316.49
7.4.220.0110.00716.52
7.4.210.0110.01116.45
7.4.200.0030.00316.46
7.4.150.0120.00617.40
7.4.140.0080.01217.86
7.4.130.0090.01316.68
7.4.120.0110.00916.54
7.4.110.0100.00716.61
7.4.100.0150.00316.54
7.4.90.0070.01016.45
7.4.80.0060.00919.39
7.4.70.0100.00616.55
7.4.60.0120.00916.54
7.4.50.0130.00316.38
7.4.40.0120.00316.35
7.4.30.0060.01116.58
7.4.00.0070.00915.00
7.3.330.0030.00313.45
7.3.320.0000.00613.39
7.3.310.0000.00816.41
7.3.300.0030.00316.42
7.3.290.0070.00816.39
7.3.280.0100.00616.42
7.3.270.0140.00317.40
7.3.260.0050.01816.43
7.3.250.0080.01116.43
7.3.240.0130.00916.46
7.3.230.0070.01116.45
7.3.210.0140.00316.45
7.3.200.0100.00716.37
7.3.190.0070.01016.37
7.3.180.0130.00316.72
7.3.170.0040.01216.34
7.3.160.0130.00316.45
7.3.120.0050.01014.84
7.3.110.0020.01614.81
7.3.100.0030.00714.85
7.3.90.0060.00814.78
7.3.80.0050.00814.92
7.3.70.0080.00514.65
7.3.60.0070.01014.84
7.3.50.0050.00814.92
7.3.40.0110.00214.92
7.3.30.0070.00914.81
7.3.20.0070.00916.77
7.3.10.0090.00516.61
7.3.00.0090.00616.56
7.2.330.0170.00916.48
7.2.320.0050.01116.74
7.2.310.0110.01116.75
7.2.300.0070.01016.79
7.2.290.0060.01416.82
7.2.250.0060.01315.12
7.2.240.0100.01015.20
7.2.230.0090.00614.88
7.2.220.0070.00414.84
7.2.210.0120.00315.13
7.2.200.0070.00714.95
7.2.190.0050.00815.08
7.2.180.0100.00514.96
7.2.170.0040.00914.94
7.2.60.0070.01016.98
7.2.00.0000.01619.50
7.1.330.0050.00915.74
7.1.320.0020.00715.94
7.1.310.0020.01215.72
7.1.300.0060.00915.81
7.1.290.0050.00815.77
7.1.280.0120.00215.94
7.1.270.0080.00815.68
7.1.260.0020.01215.82
7.1.200.0120.00315.67
7.1.70.0050.00517.25
7.1.60.0230.01732.96
7.1.50.1100.01333.12
7.1.40.0670.01332.77
7.1.30.0800.01332.60
7.1.20.1100.01332.63
7.1.10.0630.00714.53
7.1.00.0470.01314.85
7.0.200.0030.01714.88
7.0.190.0570.01314.95
7.0.180.0700.01014.34
7.0.170.0800.00714.38
7.0.160.0870.01314.25
7.0.150.0130.00014.66
7.0.140.0570.01014.51
7.0.130.0530.02014.59
7.0.120.0700.01714.62
7.0.110.0470.00314.30
7.0.100.0370.01714.68
7.0.90.0630.00314.43
7.0.80.0600.01714.77
7.0.70.0570.02014.75
7.0.60.0530.01314.39
7.0.50.0600.01714.49
7.0.40.0730.01314.75
7.0.30.1230.01314.64
7.0.20.0600.01014.55
7.0.10.0900.01014.53
7.0.00.0930.01014.64

preferences:
60.62 ms | 400 KiB | 5 Q