3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = [ 'key1' => [ 'first string' ], 'key2' => [ 'second array' ] ]; $array2 = [ 'key1' => [ 'new string from second array' ], 'key2' => [ 'second key in this other multidimensional array' ] ]; $outer_string = "Hello, this is my first string\nAnd here you can see another string from my second array"; $replacements = array(); foreach ($array1 as $k => $v) { $replacements[$v[0]] = $array2[$k][0]; } echo strtr($outer_string, $replacements);

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.5.10.0110.00516.82
8.5.00.0130.00820.03
8.4.150.0030.00014.05
8.4.140.0110.01017.64
8.4.130.0130.00717.82
8.4.120.0140.00620.57
8.4.110.0110.00822.51
8.4.100.0130.00517.57
8.4.90.0130.00818.57
8.4.80.0040.00417.67
8.4.70.0130.00717.88
8.4.60.0110.01320.42
8.4.50.0120.01017.81
8.4.40.0100.01019.29
8.4.30.0130.00717.62
8.4.20.0140.00720.57
8.4.10.0060.00317.63
8.3.280.0090.01118.50
8.3.270.0120.00716.67
8.3.260.0080.01016.43
8.3.250.0030.00518.66
8.3.240.0120.00616.64
8.3.230.0080.00716.29
8.3.220.0130.00517.37
8.3.210.0120.00616.41
8.3.200.0050.00316.55
8.3.190.0130.00717.07
8.3.180.0110.00818.52
8.3.170.0120.00616.55
8.3.160.0120.00616.78
8.3.150.0070.01116.98
8.3.140.0060.00317.10
8.3.130.0030.00518.34
8.3.120.0030.00718.95
8.3.110.0110.00020.94
8.3.100.0030.01324.06
8.3.90.0120.00626.77
8.3.80.0080.00317.97
8.3.70.0090.00616.50
8.3.60.0110.00418.15
8.3.50.0130.00718.16
8.3.40.0120.00318.63
8.3.30.0120.00318.63
8.3.20.0080.00021.03
8.3.10.0050.00321.67
8.3.00.0050.00221.90
8.2.290.0120.00720.62
8.2.280.0120.00818.25
8.2.270.0130.00616.48
8.2.260.0090.00917.09
8.2.250.0040.00416.59
8.2.240.0060.00317.48
8.2.230.0030.00722.58
8.2.220.0120.00437.54
8.2.210.0000.00726.77
8.2.200.0050.00518.43
8.2.190.0110.00716.58
8.2.180.0190.00016.75
8.2.170.0150.00022.96
8.2.160.0070.00721.07
8.2.150.0030.00624.18
8.2.140.0050.00324.66
8.2.130.0080.00026.16
8.2.120.0080.00021.12
8.2.110.0030.00619.11
8.2.100.0080.00317.78
8.2.90.0030.00618.30
8.2.80.0030.00518.05
8.2.70.0000.00818.04
8.2.60.0050.00318.22
8.2.50.0000.00918.10
8.2.40.0020.00519.33
8.2.30.0000.00719.27
8.2.20.0040.00418.18
8.2.10.0070.00019.31
8.2.00.0000.00718.13
8.1.330.0090.01021.99
8.1.320.0100.01016.28
8.1.310.0130.00718.68
8.1.300.0060.01217.67
8.1.290.0060.00318.88
8.1.280.0100.00725.92
8.1.270.0170.00323.73
8.1.260.0030.00626.35
8.1.250.0050.00328.09
8.1.240.0080.00417.33
8.1.230.0000.01420.77
8.1.220.0040.00417.74
8.1.210.0060.00318.79
8.1.200.0060.00317.23
8.1.190.0040.00417.35
8.1.180.0060.00318.10
8.1.170.0030.00618.59
8.1.160.0040.00418.88
8.1.150.0020.00518.86
8.1.140.0070.00318.90
8.1.130.0000.00720.13
8.1.120.0050.00217.53
8.1.110.0050.00217.53
8.1.100.0070.00017.46
8.1.90.0000.00717.47
8.1.80.0060.00317.35
8.1.70.0040.00417.48
8.1.60.0030.00617.61
8.1.50.0050.00317.51
8.1.40.0040.00417.42
8.1.30.0040.00417.67
8.1.20.0060.00317.63
8.1.10.0040.00417.49
8.1.00.0030.00517.51
8.0.300.0070.00019.84
8.0.290.0000.00916.75
8.0.280.0000.00718.49
8.0.270.0000.00717.18
8.0.260.0000.00818.41
8.0.250.0040.00416.85
8.0.240.0000.00816.85
8.0.230.0000.00716.94
8.0.220.0000.00816.89
8.0.210.0000.00616.76
8.0.200.0060.00616.85
8.0.190.0050.00316.91
8.0.180.0040.00416.89
8.0.170.0000.00816.96
8.0.160.0000.00716.86
8.0.150.0030.00516.88
8.0.140.0000.00716.74
8.0.130.0030.00313.33
8.0.120.0030.00516.89
8.0.110.0040.00416.96
8.0.100.0040.00416.76
8.0.90.0000.00716.80
8.0.80.0050.01216.86
8.0.70.0030.00516.85
8.0.60.0040.00416.77
8.0.50.0000.00716.88
8.0.30.0100.01016.78
8.0.20.0130.00617.40
8.0.10.0040.00416.98
8.0.00.0080.01116.83
7.4.330.0000.00415.55
7.4.320.0030.00516.45
7.4.300.0000.00616.43
7.4.290.0070.00016.61
7.4.280.0080.00016.61
7.4.270.0040.00416.50
7.4.260.0040.00416.54
7.4.250.0040.00416.52
7.4.240.0080.00016.54
7.4.230.0000.00716.43
7.4.220.0000.00816.59
7.4.210.0050.01016.56
7.4.200.0000.00716.35
7.4.160.0060.01016.43
7.4.140.0090.01417.86
7.4.130.0120.01216.64
7.4.120.0160.00616.63
7.4.110.0140.00316.40
7.4.100.0110.00716.50
7.4.90.0070.01516.41
7.4.80.0060.01219.39
7.4.70.0110.01116.62
7.4.60.0080.00816.40
7.4.50.0070.00716.30
7.4.40.0030.01316.32
7.4.00.0080.00614.76
7.3.330.0020.00213.13
7.3.320.0060.00013.23
7.3.310.0040.00416.39
7.3.300.0030.00316.38
7.3.290.0030.00316.36
7.3.280.0140.00216.39
7.3.260.0060.01116.47
7.3.240.0110.00616.40
7.3.230.0130.00316.57
7.3.210.0060.01016.56
7.3.200.0100.00616.48
7.3.190.0130.01016.27
7.3.180.0060.01016.50
7.3.170.0120.00916.39
7.3.160.0110.00716.30
7.3.10.1190.00714.72
7.3.00.0780.00914.71
7.2.330.0140.00416.80
7.2.320.0030.01316.69
7.2.310.0110.00716.71
7.2.300.0100.00616.60
7.2.290.0070.01016.71
7.2.130.0860.01015.09
7.2.120.0850.00314.96
7.2.110.0880.01014.90
7.2.100.0680.01715.05
7.2.90.0840.01015.23
7.2.80.0900.00715.16
7.2.70.1260.00314.79
7.2.60.0610.01314.77
7.2.50.0830.00715.07
7.2.40.0760.01015.23
7.2.30.0710.00715.04
7.2.20.0930.00314.80
7.2.10.0880.00715.02
7.2.00.0860.00315.07
7.1.250.0740.00313.63

preferences:
208.64 ms | 403 KiB | 5 Q