3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "blah blarh"; $searchReplaceArray = array( 'blah' => 'bleh', 'blarh' => 'blerh' ); $result = str_replace( array_keys($searchReplaceArray), array_values($searchReplaceArray), $string ); 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.0040.01118.30
8.3.50.0070.00821.96
8.3.40.0140.00718.56
8.3.30.0090.00618.96
8.3.20.0060.00320.21
8.3.10.0060.00323.42
8.3.00.0040.00420.83
8.2.180.0070.00716.50
8.2.170.0110.00422.96
8.2.160.0000.01420.35
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0000.00820.61
8.2.110.0090.00020.47
8.2.100.0110.00017.88
8.2.90.0060.00318.03
8.2.80.0040.00417.97
8.2.70.0030.00617.63
8.2.60.0080.00017.80
8.2.50.0060.00318.07
8.2.40.0030.00618.28
8.2.30.0030.00618.21
8.2.20.0040.00417.64
8.2.10.0070.00018.09
8.2.00.0040.00417.79
8.1.280.0040.01125.92
8.1.270.0080.00023.66
8.1.260.0050.00326.35
8.1.250.0070.00028.09
8.1.240.0100.00022.19
8.1.230.0030.00720.73
8.1.220.0000.00817.77
8.1.210.0000.00818.77
8.1.200.0030.00617.00
8.1.190.0080.00017.22
8.1.180.0040.00418.10
8.1.170.0000.00818.71
8.1.160.0050.00322.00
8.1.150.0040.00418.46
8.1.140.0070.00017.29
8.1.130.0030.00317.73
8.1.120.0000.00717.41
8.1.110.0000.00817.28
8.1.100.0000.00717.29
8.1.90.0060.00317.31
8.1.80.0070.00017.26
8.1.70.0000.00717.30
8.1.60.0000.00817.53
8.1.50.0030.00617.41
8.1.40.0000.00817.39
8.1.30.0040.00417.47
8.1.20.0030.00517.57
8.1.10.0040.00417.41
8.1.00.0060.00317.30
8.0.300.0040.00420.16
8.0.290.0000.00717.05
8.0.280.0030.00318.42
8.0.270.0000.00717.29
8.0.260.0000.00617.15
8.0.250.0070.00016.92
8.0.240.0000.00716.83
8.0.230.0050.00316.88
8.0.220.0030.00316.82
8.0.210.0000.00716.77
8.0.200.0040.00416.86
8.0.190.0030.00516.89
8.0.180.0030.00516.81
8.0.170.0050.00216.83
8.0.160.0040.00416.68
8.0.150.0030.00316.82
8.0.140.0040.00416.79
8.0.130.0040.00413.21
8.0.120.0040.00416.78
8.0.110.0050.00216.78
8.0.100.0000.00716.69
8.0.90.0000.00716.72
8.0.80.0090.00616.86
8.0.70.0030.00516.93
8.0.60.0000.00716.80
8.0.50.0000.00716.88
8.0.30.0090.00916.95
8.0.20.0120.00617.40
8.0.10.0040.00416.88
8.0.00.0070.01216.63
7.4.330.0000.00515.00
7.4.320.0080.00016.54
7.4.300.0030.00316.50
7.4.290.0000.00716.41
7.4.280.0030.00316.36
7.4.270.0050.00316.53
7.4.260.0030.00516.46
7.4.250.0030.00516.49
7.4.240.0030.00516.44
7.4.230.0000.00716.62
7.4.220.0070.01116.59
7.4.210.0050.00916.52
7.4.200.0030.00516.27
7.4.190.0000.00716.68
7.4.160.0130.00316.61
7.4.150.0100.00717.40
7.4.140.0090.00817.86
7.4.130.0140.01316.35
7.4.120.0030.01416.38
7.4.110.0100.00616.44
7.4.100.0070.01016.28
7.4.90.0120.00616.45
7.4.80.0160.00619.39
7.4.70.0150.00616.47
7.4.60.0070.01016.48
7.4.50.0040.00416.39
7.4.40.0070.01116.50
7.4.30.0030.01316.54
7.4.00.0000.01314.98
7.3.330.0000.00512.94
7.3.320.0020.00212.91
7.3.310.0000.00716.18
7.3.300.0040.00416.23
7.3.290.0100.01016.20
7.3.280.0070.01016.17
7.3.270.0000.01717.40
7.3.260.0090.00916.20
7.3.250.0100.00816.27
7.3.240.0060.01216.55
7.3.230.0070.01116.39
7.3.210.0050.01316.21
7.3.200.0090.01519.39
7.3.190.0120.00916.31
7.3.180.0030.01216.34
7.3.170.0030.01216.27
7.3.160.0090.00616.11
7.3.120.0060.00314.67
7.2.330.0090.00916.62
7.2.320.0040.01216.36
7.2.310.0080.00816.69
7.2.300.0120.00816.56
7.2.290.0090.01416.68
7.2.00.0080.00819.48
7.1.100.0130.00617.93
7.1.70.0000.01516.90
7.1.60.0070.00317.30
7.1.50.0040.00716.78
7.1.00.0070.09322.37
7.0.200.0000.01616.76
7.0.140.0070.06322.07
7.0.60.0170.07720.00
7.0.50.0030.06717.88
7.0.40.0100.06020.05
7.0.30.0300.04720.33
7.0.20.0200.08320.19
7.0.10.0230.07020.33
7.0.00.0100.08020.16
5.6.280.0070.07020.81
5.6.210.0070.08020.47
5.6.200.0100.07718.11
5.6.190.0070.09020.49
5.6.180.3300.04020.54
5.6.170.0300.07720.55
5.6.160.0070.09020.42
5.6.150.0100.03318.22
5.6.140.0130.06718.10
5.6.130.0070.04018.13
5.6.120.0100.03320.88
5.6.110.0070.04020.99
5.6.100.0130.06721.02
5.6.90.0130.07320.95
5.6.80.0070.07320.43
5.6.70.0030.07020.33
5.5.350.0200.08320.40
5.5.340.0070.07717.93
5.5.330.0100.07720.21
5.5.320.0430.05320.07
5.5.310.0300.04720.30
5.5.300.0030.04717.97
5.5.290.0070.05017.98
5.5.280.0030.05320.74
5.5.270.0070.03720.83
5.5.260.0030.04020.95
5.5.250.0070.03720.68
5.5.240.0070.07320.16
5.4.450.0000.06719.14
5.4.440.0600.06019.47
5.4.430.0730.05319.58
5.4.420.0730.00019.25
5.4.410.0230.05718.97
5.4.400.0230.05018.50
5.4.390.0300.05718.59
5.4.380.0300.05018.71
5.4.370.0130.04718.77
5.4.360.0130.04718.47
5.4.350.0090.04411.97
5.4.340.0100.04411.97
5.4.320.0110.04812.45
5.4.310.0050.04412.45
5.4.300.0070.04312.45
5.4.290.0070.04612.45
5.4.280.0100.04112.35
5.4.270.0060.03712.34
5.4.260.0070.03712.35
5.4.250.0090.05112.35
5.4.240.0120.06312.34
5.4.230.0100.04312.34
5.4.220.0060.05212.34
5.4.210.0180.05112.34
5.4.200.0100.04212.34
5.4.190.0060.03812.34
5.4.180.0080.03512.33
5.4.170.0110.03312.35
5.4.160.0110.04212.34
5.4.150.0070.04812.34
5.4.140.0070.05212.02
5.4.130.0040.04212.01
5.4.120.0080.04911.96
5.4.110.0140.07111.96
5.4.100.0200.07511.96
5.4.90.0080.05211.96
5.4.80.0060.05111.96
5.4.70.0070.05111.96
5.4.60.0070.05211.96
5.4.50.0120.04811.96
5.4.40.0090.04611.95
5.4.30.0060.04911.95
5.4.20.0040.05211.95
5.4.10.0070.04811.95
5.4.00.0090.04811.43
5.3.290.0090.03612.80
5.3.280.0080.05312.71
5.3.270.0050.06312.73
5.3.260.0100.05512.72
5.3.250.0080.05312.71
5.3.240.0110.05112.72
5.3.230.0130.04612.71
5.3.220.0080.05012.68
5.3.210.0100.05012.68
5.3.200.0050.05112.68
5.3.190.0120.04512.68
5.3.180.0080.05012.67
5.3.170.0100.04912.67
5.3.160.0080.03512.67
5.3.150.0060.04212.67
5.3.140.0090.05412.66
5.3.130.0060.05912.66
5.3.120.0060.05812.66
5.3.110.0110.05312.66
5.3.100.0040.06312.12
5.3.90.0070.05712.09
5.3.80.0080.05412.07
5.3.70.0090.05312.08
5.3.60.0070.05512.07
5.3.50.0080.04712.00
5.3.40.0090.05012.00
5.3.30.0070.05211.94
5.3.20.0090.04611.72
5.3.10.0080.04611.69
5.3.00.0100.04811.68
5.2.170.0060.0429.18
5.2.160.0070.0379.18
5.2.150.0090.0389.18
5.2.140.0040.0439.17
5.2.130.0040.0419.14
5.2.120.0040.0379.14
5.2.110.0060.0359.14
5.2.100.0030.0409.14
5.2.90.0070.0389.14
5.2.80.0070.0409.13
5.2.70.0060.0409.13
5.2.60.0040.0429.09
5.2.50.0040.0419.06
5.2.40.0050.0369.03
5.2.30.0060.0379.01
5.2.20.0060.0389.00
5.2.10.0060.0408.92
5.2.00.0060.0388.77
5.1.60.0050.0338.06
5.1.50.0050.0338.06
5.1.40.0040.0348.04
5.1.30.0090.0318.39
5.1.20.0070.0348.41
5.1.10.0060.0348.13
5.1.00.0100.0318.13
5.0.50.0030.0286.62
5.0.40.0060.0266.47
5.0.30.0060.0396.29
5.0.20.0090.0226.26
5.0.10.0030.0296.23
5.0.00.0090.0356.23
4.4.90.0050.0214.78
4.4.80.0030.0234.76
4.4.70.0040.0224.75
4.4.60.0060.0184.76
4.4.50.0040.0214.77
4.4.40.0060.0314.71
4.4.30.0030.0214.76
4.4.20.0040.0224.85
4.4.10.0060.0194.85
4.4.00.0050.0314.75
4.3.110.0040.0214.67
4.3.100.0060.0204.66
4.3.90.0060.0194.63
4.3.80.0020.0324.58
4.3.70.0030.0164.63
4.3.60.0060.0144.63
4.3.50.0010.0184.63
4.3.40.0050.0234.54
4.3.30.0030.0183.28
4.3.20.0020.0213.26
4.3.10.0040.0193.22
4.3.00.0100.0236.40

preferences:
30.86 ms | 401 KiB | 5 Q