3v4l.org

run code in 300+ PHP versions simultaneously
<?php $keywords = ['test', 'value']; $replace = array_map(function($key) { return '<span>' . $key . '</span>'; }, $keywords); print_r($replace); $string = 'Hello world. This is a test.'; $render = str_replace($keywords, $replace, $string); echo $render;

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.40.0060.00918.44
8.3.30.0070.00718.92
8.3.20.0040.00420.34
8.3.10.0000.00822.09
8.3.00.0120.00322.48
8.2.170.0070.00722.96
8.2.160.0120.00920.97
8.2.150.0110.00024.18
8.2.140.0000.00824.66
8.2.130.0170.00026.16
8.2.120.0040.00717.50
8.2.110.0110.00722.08
8.2.100.0080.00417.78
8.2.90.0000.00719.11
8.2.80.0060.00317.97
8.2.70.0040.00417.63
8.2.60.0080.00517.64
8.2.50.0030.00518.10
8.2.40.0040.00418.28
8.2.30.0040.00418.13
8.2.20.0070.00017.58
8.2.10.0000.00819.44
8.2.00.0000.00717.78
8.1.270.0040.00422.16
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0100.00721.99
8.1.230.0040.00717.76
8.1.220.0040.00417.78
8.1.210.0070.00318.77
8.1.200.0050.00517.25
8.1.190.0040.00417.23
8.1.180.0080.00018.10
8.1.170.0090.00018.57
8.1.160.0000.00721.95
8.1.150.0030.00518.60
8.1.140.0030.00517.46
8.1.130.0030.00317.71
8.1.120.0000.00717.38
8.1.110.0040.00417.46
8.1.100.0070.00017.45
8.1.90.0000.00817.49
8.1.80.0040.00417.43
8.1.70.0030.00317.34
8.1.60.0090.00017.61
8.1.50.0070.00017.58
8.1.40.0000.00917.48
8.1.30.0040.00417.62
8.1.20.0030.00517.63
8.1.10.0000.00717.49
8.1.00.0060.00317.42
8.0.300.0040.00418.77
8.0.290.0040.00416.75
8.0.280.0000.00818.36
8.0.270.0040.00417.19
8.0.260.0040.00416.72
8.0.250.0000.00716.94
8.0.240.0000.00816.85
8.0.230.0030.00316.83
8.0.220.0000.00716.80
8.0.210.0000.00716.88
8.0.200.0070.00016.94
8.0.190.0050.00516.91
8.0.180.0070.00016.77
8.0.170.0080.00016.82
8.0.160.0000.00816.95
8.0.150.0030.00316.89
8.0.140.0070.00016.77
8.0.130.0000.00513.33
8.0.120.0050.00216.80
8.0.110.0070.00016.86
8.0.100.0040.00316.71
8.0.90.0040.00416.75
8.0.80.0050.01016.86
8.0.70.0080.00016.79
8.0.60.0070.00016.98
8.0.50.0040.00417.00
8.0.30.0090.00916.97
8.0.20.0120.00817.40
8.0.10.0040.00416.88
8.0.00.0140.00616.64
7.4.330.0060.00015.00
7.4.320.0000.00616.44
7.4.300.0030.00316.36
7.4.290.0030.00316.61
7.4.280.0030.00316.39
7.4.270.0070.00016.49
7.4.260.0000.00716.48
7.4.250.0040.00416.55
7.4.240.0030.00516.46
7.4.230.0000.00716.70
7.4.220.0070.01016.62
7.4.210.0080.00616.57
7.4.200.0050.00216.61
7.4.190.0070.00016.43
7.4.160.0150.00716.61
7.4.150.0070.01417.40
7.4.140.0130.01017.86
7.4.130.0090.01116.28
7.4.120.0160.00416.45
7.4.110.0070.01016.54
7.4.100.0090.00916.38
7.4.90.0120.00616.52
7.4.80.0030.01419.39
7.4.70.0130.00616.59
7.4.60.0040.01216.37
7.4.50.0000.00516.29
7.4.40.0000.01622.77
7.4.30.0060.01216.53
7.4.00.0070.00814.92
7.3.330.0000.00513.16
7.3.320.0030.00313.25
7.3.310.0000.00716.33
7.3.300.0000.00716.28
7.3.290.0060.01016.27
7.3.280.0060.01016.29
7.3.270.0100.00717.40
7.3.260.0130.00716.47
7.3.250.0100.00716.47
7.3.240.0160.00516.49
7.3.230.0070.01016.39
7.3.210.0100.00716.45
7.3.200.0100.01319.39
7.3.190.0070.01016.24
7.3.180.0110.01216.68
7.3.170.0100.00616.38
7.3.160.0160.00016.25
7.3.120.0070.01014.79
7.3.110.0100.01015.02
7.3.100.0030.01014.87
7.3.90.0070.00714.73
7.3.80.0070.00715.13
7.3.70.0060.01315.00
7.3.60.0030.01314.89
7.3.50.0070.00414.74
7.3.40.0030.00714.60
7.3.30.0040.01114.71
7.3.20.0110.00416.88
7.3.10.0100.00016.45
7.3.00.0070.00316.70
7.2.330.0090.00916.84
7.2.320.0040.01416.41
7.2.310.0030.01316.35
7.2.300.0150.00316.75
7.2.290.0100.00716.43
7.2.250.0060.00914.94
7.2.240.0000.01715.27
7.2.230.0060.00314.95
7.2.220.0060.00915.14
7.2.210.0000.01415.03
7.2.200.0000.01715.01
7.2.190.0090.00915.11
7.2.180.0000.00915.04
7.2.170.0080.00315.16
7.2.60.0040.00816.95
7.1.330.0070.01015.79
7.1.320.0100.01015.62
7.1.310.0030.01315.56
7.1.300.0100.00716.05
7.1.290.0070.00715.61
7.1.280.0070.00715.84
7.1.270.0100.00015.83
7.1.260.0080.00015.84
7.1.200.0050.00516.00
7.1.100.0070.00718.06
7.1.70.0040.00717.22
7.1.60.0130.01319.82
7.1.50.0170.00717.02
7.1.00.0100.07022.30
7.0.200.0030.00716.73
7.0.140.0000.07322.15
7.0.60.0070.08019.93
7.0.50.0100.08017.85
7.0.40.0030.08320.11
7.0.30.0070.05020.20
7.0.20.0100.04720.11
7.0.10.0100.08320.33
7.0.00.0130.06320.05
5.6.280.0070.07021.10
5.6.210.0100.08320.52
5.6.200.0030.06718.15
5.6.190.0030.07320.38
5.6.180.3400.04720.63
5.6.170.0330.07020.51
5.6.160.0070.06320.57
5.6.150.0100.06318.21
5.6.140.0130.03318.18
5.6.130.0070.05018.28
5.6.120.0000.04721.00
5.6.110.0030.09320.98
5.6.100.0030.09021.09
5.6.90.0070.08320.93
5.6.80.0070.06020.38
5.6.70.4030.04320.43
5.5.350.0270.07720.44
5.5.340.0030.04018.07
5.5.330.0100.08020.42
5.5.320.3900.03320.20
5.5.310.0330.07020.21
5.5.300.0070.07718.00
5.5.290.0070.03718.01
5.5.280.0030.05020.82
5.5.270.0070.06320.76
5.5.260.0170.07320.87
5.5.250.0200.06320.63
5.5.240.0170.07320.28
5.4.450.0200.06019.49
5.4.440.0200.05019.20
5.4.430.0100.05319.41
5.4.420.0170.07019.54
5.4.410.0030.06019.25
5.4.400.0800.00018.81
5.4.390.0830.00018.63
5.4.380.0430.06018.80
5.4.370.0330.05018.59
5.4.360.0370.05018.51
5.4.350.0330.05318.78
5.4.340.0270.05318.79
5.4.320.0050.03712.50
5.4.310.0070.04212.50
5.4.300.0080.03712.51
5.4.290.0060.04312.50
5.4.280.0050.03712.39
5.4.270.0040.04012.40
5.4.260.0030.05718.99
5.4.250.0070.05319.02
5.4.240.0130.05318.94
5.4.230.0130.07018.97
5.4.220.0170.05718.93
5.4.210.0130.05318.84
5.4.200.0130.04719.09
5.4.190.0170.04318.75
5.4.180.0130.05018.83
5.4.170.0000.06018.89
5.4.160.0130.05718.63
5.4.150.0130.07318.63
5.4.140.0130.05316.54
5.4.130.0170.06716.36
5.4.120.0100.07316.53
5.4.110.0170.04716.55
5.4.100.0000.05716.29
5.4.90.0100.05016.39
5.4.80.0130.05716.54
5.4.70.0070.05316.47
5.4.60.0130.04716.35
5.4.50.0100.07316.26
5.4.40.0030.06316.68
5.4.30.0100.06016.52
5.4.20.0070.05316.52
5.4.10.0070.05016.43
5.4.00.0030.05715.82
5.3.290.0070.04712.80
5.3.280.0130.06314.43
5.3.270.0070.08014.66
5.3.260.0130.06714.52
5.3.250.0170.04714.50
5.3.240.0030.07014.70
5.3.230.0130.06014.44
5.3.220.0070.07714.59
5.3.210.0130.07714.50
5.3.200.0170.04314.34
5.3.190.0070.06314.56
5.3.180.0200.03714.45
5.3.170.0130.05314.59
5.3.160.0000.06014.72
5.3.150.0200.06714.58
5.3.140.0070.07714.58
5.3.130.0100.05314.25
5.3.120.0100.06014.57
5.3.110.0130.05014.55
5.3.100.0100.07013.89
5.3.90.0070.05313.96
5.3.80.0100.05013.88
5.3.70.0130.04314.17
5.3.60.0100.05014.01
5.3.50.0030.05013.83
5.3.40.0130.05013.89
5.3.30.0130.07013.92
5.3.20.0100.04313.73
5.3.10.0000.07013.64
5.3.00.0170.04013.58
5.2.170.0070.04011.29
5.2.160.0000.06011.05
5.2.150.0070.06011.07
5.2.140.0030.04311.14
5.2.130.0030.04310.86
5.2.120.0070.04311.10
5.2.110.0170.03011.09
5.2.100.0030.04011.01
5.2.90.0070.04011.12
5.2.80.0130.04711.02
5.2.70.0070.04011.09
5.2.60.0100.05710.80
5.2.50.0070.04011.04
5.2.40.0130.04711.14
5.2.30.0030.04310.99
5.2.20.0100.04010.87
5.2.10.0100.03310.70
5.2.00.0070.04010.71
5.1.60.0100.04710.05
5.1.50.0030.03710.23
5.1.40.0100.0309.89
5.1.30.0070.03710.49
5.1.20.0100.03710.11
5.1.10.0000.05710.09
5.1.00.0100.04710.13
5.0.50.0070.0308.50
5.0.40.0070.0278.55
5.0.30.0030.0438.24
5.0.20.0030.0278.42
5.0.10.0030.0408.20
5.0.00.0070.0538.24
4.4.90.0070.0176.82
4.4.80.0100.0206.82
4.4.70.0030.0206.82
4.4.60.0030.0206.82
4.4.50.0000.0336.82
4.4.40.0000.0406.82
4.4.30.0100.0206.82
4.4.20.0030.0306.82
4.4.10.0000.0336.82
4.4.00.0030.0376.82
4.3.110.0070.0236.82
4.3.100.0170.0176.82
4.3.90.0070.0206.82
4.3.80.0030.0406.82
4.3.70.0000.0236.82
4.3.60.0070.0176.82
4.3.50.0030.0306.82
4.3.40.0000.0376.82
4.3.30.0030.0206.82
4.3.20.0030.0206.82
4.3.10.0030.0206.82
4.3.00.0030.0207.32

preferences:
48.4 ms | 400 KiB | 5 Q