3v4l.org

run code in 300+ PHP versions simultaneously
<?php $searchReplaceArray = array( '&#038;' => '&', ); $result = str_replace( array_keys($searchReplaceArray), array_values($searchReplaceArray), $string ); $string = "aaaa &#038; aaaa"; echo $result; $string = "bbbb &#038; bbbb"; echo $result;

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.00918.43
8.3.50.0120.00521.99
8.3.40.0140.00018.66
8.3.30.0120.00318.90
8.3.20.0040.00420.30
8.3.10.0080.00023.43
8.3.00.0080.00020.94
8.2.180.0110.01116.38
8.2.170.0140.00022.96
8.2.160.0130.00320.37
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0050.00320.82
8.2.110.0080.00022.14
8.2.100.0090.00317.72
8.2.90.0000.00719.08
8.2.80.0000.00817.97
8.2.70.0080.00017.63
8.2.60.0040.00417.93
8.2.50.0030.00618.07
8.2.40.0040.00419.78
8.2.30.0030.00520.04
8.2.20.0040.00417.65
8.2.10.0080.00018.11
8.2.00.0000.00717.80
8.1.280.0100.01025.92
8.1.270.0060.00323.87
8.1.260.0030.00626.35
8.1.250.0040.00428.09
8.1.240.0100.00023.96
8.1.230.0110.00019.11
8.1.220.0080.00017.74
8.1.210.0040.00418.77
8.1.200.0080.00417.22
8.1.190.0040.00417.22
8.1.180.0030.00618.10
8.1.170.0000.00918.57
8.1.160.0050.00321.95
8.1.150.0040.00418.48
8.1.140.0040.00417.38
8.1.130.0070.00017.80
8.1.120.0000.00717.43
8.1.110.0040.00417.27
8.1.100.0040.00417.43
8.1.90.0030.00517.40
8.1.80.0000.00817.28
8.1.70.0030.00317.34
8.1.60.0050.00317.40
8.1.50.0050.00317.45
8.1.40.0030.00517.35
8.1.30.0000.00817.44
8.1.20.0040.00417.65
8.1.10.0070.00017.55
8.1.00.0030.00617.40
8.0.300.0080.00018.77
8.0.290.0000.00717.16
8.0.280.0000.00718.35
8.0.270.0070.00017.25
8.0.260.0000.00617.24
8.0.250.0000.00716.97
8.0.240.0040.00416.89
8.0.230.0070.00016.91
8.0.220.0080.00016.89
8.0.210.0060.00016.84
8.0.200.0040.00416.86
8.0.190.0060.00316.96
8.0.180.0000.00716.79
8.0.170.0000.00716.81
8.0.160.0000.00716.94
8.0.150.0000.00716.93
8.0.140.0030.00316.72
8.0.130.0030.00613.29
8.0.120.0040.00416.87
8.0.110.0020.00516.87
8.0.100.0050.00316.91
8.0.90.0050.00317.00
8.0.80.0120.00616.87
8.0.70.0040.00416.91
8.0.60.0050.00316.89
8.0.50.0040.00416.83
8.0.30.0090.01017.24
8.0.20.0150.00317.40
8.0.10.0040.00416.98
8.0.00.0120.01016.92
7.4.330.0030.00315.00
7.4.320.0030.00616.54
7.4.300.0000.00616.41
7.4.290.0040.00216.45
7.4.280.0030.00316.52
7.4.270.0030.00316.46
7.4.260.0040.00416.41
7.4.250.0040.00416.32
7.4.240.0030.00316.46
7.4.230.0030.00316.61
7.4.220.0140.00416.54
7.4.210.0050.01016.56
7.4.200.0000.00716.43
7.4.190.0000.00716.61
7.4.160.0050.01116.30
7.4.150.0110.00717.40
7.4.140.0120.00717.86
7.4.130.0030.01516.39
7.4.120.0120.00416.44
7.4.110.0100.00616.43
7.4.100.0120.00916.46
7.4.90.0070.01016.32
7.4.80.0040.01419.39
7.4.70.0030.01416.49
7.4.60.0060.00916.67
7.4.50.0060.00016.40
7.4.40.0160.00016.38
7.4.30.0030.01216.62
7.4.00.0070.00714.87
7.3.330.0000.00513.11
7.3.320.0000.00513.16
7.3.310.0040.00416.32
7.3.300.0030.00316.30
7.3.290.0060.00916.30
7.3.280.0090.00916.24
7.3.270.0110.00517.40
7.3.260.0100.00716.28
7.3.250.0110.00516.29
7.3.240.0040.01216.24
7.3.230.0100.00716.39
7.3.210.0030.01616.46
7.3.200.0160.00719.39
7.3.190.0060.01116.45
7.3.180.0130.00616.28
7.3.170.0070.01016.27
7.3.160.0090.00616.52
7.3.120.0090.00514.82
7.3.110.0000.01214.78
7.3.100.0100.00714.92
7.3.90.0070.00714.71
7.3.80.0000.00914.70
7.3.70.0030.01014.59
7.3.60.0040.01114.74
7.3.50.0040.00714.64
7.3.40.0070.00714.57
7.3.30.0000.00914.75
7.3.20.0060.01016.54
7.3.10.0030.01016.76
7.3.00.0060.01016.48
7.2.330.0040.01416.57
7.2.320.0000.01716.38
7.2.310.0060.01016.54
7.2.300.0000.01616.61
7.2.290.0130.00916.70
7.2.250.0110.00415.13
7.2.240.0060.01315.07
7.2.230.0130.00315.17
7.2.220.0060.00314.84
7.2.210.0030.00914.89
7.2.200.0100.00315.00
7.2.190.0000.01514.93
7.2.180.0070.00714.67
7.2.170.0040.01114.91
7.2.60.0060.00916.79
7.2.00.0060.00619.32
7.1.330.0030.00915.86
7.1.320.0030.01015.91
7.1.310.0080.00415.72
7.1.300.0000.01115.75
7.1.290.0060.00615.82
7.1.280.0050.00515.77
7.1.270.0040.01115.57
7.1.260.0040.01215.84
7.1.200.0050.00515.90
7.1.100.0040.00818.19
7.1.70.0000.01617.10
7.1.60.0030.02019.46
7.1.50.0030.01716.79
7.1.00.0030.07722.36
7.0.200.0060.00616.40
7.0.140.0100.06322.18
7.0.60.0070.08719.96
7.0.50.0000.05317.66
7.0.40.0030.09020.23
7.0.30.0330.07720.00
7.0.20.0330.07720.16
7.0.10.0100.07020.02
7.0.00.0130.08020.12
5.6.210.0070.08020.67
5.6.200.0070.07318.22
5.6.190.0070.09020.32
5.6.180.0230.07320.56
5.6.170.0270.05020.62
5.6.160.0100.06020.40
5.6.150.0100.08018.11
5.6.140.0070.08018.16
5.6.130.0070.03718.11
5.6.120.0000.04320.89
5.6.110.0170.05320.95
5.6.100.0030.04021.10
5.6.90.0130.07321.15
5.6.80.0170.07320.34
5.5.350.4130.04720.44
5.5.340.0070.07717.96
5.5.330.0000.07720.32
5.5.320.0270.06720.21
5.5.310.0300.08320.21
5.5.300.0130.03018.00
5.5.290.0130.07717.98
5.5.280.0070.07320.97
5.5.270.0000.08720.71
5.5.260.0130.07720.79
5.5.250.0070.08020.67
5.5.240.0070.07320.03
5.4.450.0630.07019.46
5.4.440.0330.04319.41
5.4.430.0200.05019.42
5.4.420.0430.03749.64
5.4.410.0270.05045.52
5.4.400.0370.03741.98
5.4.390.0300.04740.27
5.4.380.0370.06718.59
5.4.370.0300.06718.68
5.4.360.0370.05718.71
5.4.350.0470.07718.71
5.4.340.0500.07318.64
5.4.320.0080.03712.45
5.4.310.0030.04012.45
5.4.300.0030.04412.45
5.4.290.0080.04412.45
5.4.280.0100.03912.35
5.4.270.0100.06112.35
5.4.260.0090.05012.34
5.4.250.0100.04712.35
5.4.240.0070.04212.35
5.4.230.0090.03612.34
5.4.220.0070.04912.34
5.4.210.0060.04912.34
5.4.200.0080.05012.34
5.4.190.0050.05112.34
5.4.180.0070.04912.33
5.4.170.0100.04712.35
5.4.160.0110.04212.34
5.4.150.0050.04612.34
5.4.140.0050.04112.02
5.4.130.0070.03712.01
5.4.120.0110.03511.97
5.4.110.0110.03711.96
5.4.100.0090.03811.96
5.4.90.0130.03911.96
5.4.80.0150.03611.96
5.4.70.0110.03611.96
5.4.60.0120.03511.96
5.4.50.0090.04211.96
5.4.40.0080.04811.95
5.4.30.0110.04111.95
5.4.20.0120.03111.95
5.4.10.0100.03211.95
5.4.00.0080.03611.44
5.3.290.0110.04612.80
5.3.280.0150.03612.71
5.3.270.0100.04712.72
5.3.260.0090.05512.72
5.3.250.0060.05712.72
5.3.240.0090.05312.72
5.3.230.0080.05212.71
5.3.220.0150.04812.68
5.3.210.0080.05712.68
5.3.200.0090.04912.68
5.3.190.0120.04712.68
5.3.180.0090.04812.67
5.3.170.0130.04312.67
5.3.160.0110.05012.67
5.3.150.0070.04412.68
5.3.140.0100.04912.66
5.3.130.0090.05112.66
5.3.120.0110.04912.65
5.3.110.0130.04712.66
5.3.100.0120.04412.11
5.3.90.0090.04812.08
5.3.80.0080.04612.07
5.3.70.0130.04312.08
5.3.60.0100.04612.06
5.3.50.0110.04412.00
5.3.40.0080.04812.00
5.3.30.0080.04811.95
5.3.20.0100.04411.72
5.3.10.0100.04411.69
5.3.00.0090.04711.67
5.2.170.0060.0369.18
5.2.160.0120.0449.18
5.2.150.0080.0379.18
5.2.140.0080.0329.18
5.2.130.0080.0309.13
5.2.120.0060.0389.13
5.2.110.0080.0299.14
5.2.100.0050.0319.14
5.2.90.0130.0439.14
5.2.80.0020.0339.14
5.2.70.0060.0289.14
5.2.60.0060.0289.08
5.2.50.0050.0309.05
5.2.40.0060.0299.03
5.2.30.0060.0289.01
5.2.20.0100.0359.00
5.2.10.0080.0378.92
5.2.00.0060.0418.77
5.1.60.0070.0338.06
5.1.50.0080.0318.05
5.1.40.0050.0358.04
5.1.30.0070.0368.39
5.1.20.0050.0268.41
5.1.10.0040.0268.14
5.1.00.0040.0268.13
5.0.50.0050.0186.62
5.0.40.0040.0306.48
5.0.30.0030.0486.29
5.0.20.0090.0246.26
5.0.10.0050.0276.24
5.0.00.0060.0316.23
4.4.90.0000.0184.78
4.4.80.0050.0134.75
4.4.70.0040.0184.75
4.4.60.0030.0184.76
4.4.50.0030.0154.77
4.4.40.0030.0254.71
4.4.30.0040.0154.76
4.4.20.0010.0174.84
4.4.10.0030.0164.85
4.4.00.0020.0264.76
4.3.110.0010.0184.67
4.3.100.0030.0154.66
4.3.90.0020.0164.63
4.3.80.0030.0284.58
4.3.70.0030.0184.63
4.3.60.0040.0204.63
4.3.50.0010.0164.63
4.3.40.0050.0214.54
4.3.30.0000.0193.28
4.3.20.0010.0173.25
4.3.10.0020.0153.22
4.3.00.0030.01738.80

preferences:
49.6 ms | 401 KiB | 5 Q