3v4l.org

run code in 300+ PHP versions simultaneously
<?php $my_string = "newtext!234@@random_text@@weludud"; $new_text = 'replaced_text'; $var = explode('@@',$my_string); //create an array with 3 parts, the middle one being the text to be replaced $var[1]=$new_text; $my_string=implode('@@',$var); echo $my_string; ?>

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.0190.00318.30
8.3.50.0130.00821.10
8.3.40.0120.00618.88
8.3.30.0100.00319.17
8.3.20.0040.00420.17
8.3.10.0080.00021.94
8.3.00.0050.00519.50
8.2.180.0080.00816.63
8.2.170.0060.00922.96
8.2.160.0140.00020.35
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0080.00026.16
8.2.120.0030.00322.05
8.2.110.0100.00020.35
8.2.100.0110.00017.63
8.2.90.0000.00719.30
8.2.80.0000.00817.97
8.2.70.0030.00517.75
8.2.60.0110.00017.68
8.2.50.0080.00018.07
8.2.40.0080.00020.07
8.2.30.0040.00418.00
8.2.20.0040.00417.66
8.2.10.0000.00817.99
8.2.00.0040.00417.72
8.1.280.0110.00425.92
8.1.270.0050.00322.19
8.1.260.0070.00026.35
8.1.250.0050.00228.09
8.1.240.0100.01023.95
8.1.230.0030.00917.42
8.1.220.0000.00817.74
8.1.210.0000.00818.77
8.1.200.0040.00417.25
8.1.190.0030.00517.23
8.1.180.0040.00418.10
8.1.170.0080.00018.42
8.1.160.0000.00721.94
8.1.150.0000.00718.82
8.1.140.0050.00217.25
8.1.130.0070.00017.86
8.1.120.0030.00317.33
8.1.110.0050.00217.39
8.1.100.0000.00717.30
8.1.90.0030.00517.32
8.1.80.0000.00917.37
8.1.70.0030.00517.26
8.1.60.0000.01017.52
8.1.50.0000.00817.42
8.1.40.0050.00317.32
8.1.30.0080.00017.49
8.1.20.0070.00017.59
8.1.10.0030.00617.48
8.1.00.0040.00417.46
8.0.300.0020.00518.77
8.0.290.0070.00016.75
8.0.280.0020.00518.31
8.0.270.0030.00317.15
8.0.260.0030.00317.23
8.0.250.0030.00316.98
8.0.240.0000.00616.93
8.0.230.0030.00316.75
8.0.220.0050.00216.80
8.0.210.0020.00516.84
8.0.200.0030.00716.84
8.0.190.0070.00016.79
8.0.180.0040.00416.91
8.0.170.0050.00316.86
8.0.160.0030.00516.91
8.0.150.0040.00416.64
8.0.140.0070.00416.81
8.0.130.0000.00513.15
8.0.120.0030.00516.66
8.0.110.0000.00816.78
8.0.100.0050.00216.82
8.0.90.0000.00816.86
8.0.80.0060.01216.80
8.0.70.0040.00416.70
8.0.60.0040.00416.82
8.0.50.0040.00416.86
8.0.30.0160.00317.01
8.0.20.0120.00817.40
8.0.10.0030.00616.94
8.0.00.0100.00816.64
7.4.330.0060.00015.02
7.4.320.0000.00616.42
7.4.300.0000.00616.42
7.4.290.0030.00316.33
7.4.280.0040.00416.51
7.4.270.0070.00016.54
7.4.260.0040.00416.52
7.4.250.0030.00516.46
7.4.240.0030.00416.39
7.4.230.0040.00416.53
7.4.220.0100.00716.37
7.4.210.0080.00616.53
7.4.200.0030.00316.49
7.4.160.0040.01116.42
7.4.150.0070.01017.40
7.4.140.0100.01417.86
7.4.130.0100.00716.49
7.4.120.0120.00816.48
7.4.110.0070.01116.55
7.4.100.0070.01016.64
7.4.90.0060.01016.55
7.4.80.0100.00719.39
7.4.70.0080.01216.41
7.4.60.0130.00316.41
7.4.50.0000.00516.57
7.4.40.0030.01316.46
7.4.30.0030.01316.19
7.4.00.0070.01114.95
7.3.330.0000.00613.17
7.3.320.0030.00313.25
7.3.310.0000.00716.26
7.3.300.0070.00016.30
7.3.290.0100.00416.30
7.3.280.0100.00716.27
7.3.270.0030.01517.40
7.3.260.0170.00616.59
7.3.250.0090.00916.35
7.3.240.0140.00316.29
7.3.230.0100.01016.39
7.3.210.0060.01216.30
7.3.200.0160.00319.39
7.3.190.0150.00916.29
7.3.180.0030.01316.59
7.3.170.0030.01216.40
7.3.160.0090.00616.47
7.3.120.0070.01014.52
7.3.110.0030.00714.72
7.3.100.0040.01114.97
7.3.90.0070.01014.82
7.3.80.0030.00714.49
7.3.70.0040.01114.75
7.3.60.0100.00314.82
7.3.50.0040.00714.55
7.3.40.0100.00714.81
7.3.30.0100.00614.68
7.3.20.0000.01216.70
7.3.10.0000.01116.56
7.3.00.0080.00416.80
7.2.330.0130.00316.50
7.2.320.0130.00316.63
7.2.310.0070.01016.65
7.2.300.0060.01216.64
7.2.290.0060.01016.50
7.2.250.0060.00914.82
7.2.240.0060.01215.00
7.2.230.0000.01315.11
7.2.220.0030.00715.09
7.2.210.0090.00315.17
7.2.200.0040.00814.98
7.2.190.0030.01315.18
7.2.180.0030.01214.96
7.2.170.0030.01414.88
7.2.80.0070.00716.82
7.2.60.0030.01016.99
7.2.00.0120.00819.36
7.1.330.0070.00715.83
7.1.320.0040.00815.73
7.1.310.0030.01015.92
7.1.300.0000.00915.81
7.1.290.0040.00715.88
7.1.280.0070.01015.49
7.1.270.0080.00315.92
7.1.260.0030.00715.86
7.1.200.0060.00615.76
7.1.100.0040.01117.92
7.1.70.0000.00816.93
7.1.60.0060.01319.11
7.1.50.0150.01117.06
7.1.00.0000.08022.33
7.0.200.0040.00416.77
7.0.140.0030.07022.05
7.0.60.0070.06719.79
7.0.50.0000.04017.90
7.0.40.0070.08720.08
7.0.30.0130.04720.21
7.0.20.0300.06720.02
7.0.10.0030.04720.16
7.0.00.0030.04720.08
5.6.280.0030.07720.81
5.6.210.0070.06720.63
5.6.200.0130.06718.16
5.6.190.0030.07020.66
5.6.180.0170.04320.45
5.6.170.0370.06720.50
5.6.160.0100.08020.44
5.6.150.0100.03718.20
5.6.140.0100.07718.14
5.6.130.0100.06718.16
5.6.120.0100.08021.08
5.6.110.0070.06020.88
5.6.100.0100.03321.07
5.6.90.0000.04720.99
5.6.80.0030.08720.38
5.5.350.3170.02720.39
5.5.340.0030.08017.89
5.5.330.0030.04720.38
5.5.320.0230.08020.50
5.5.310.0170.03720.50
5.5.300.0030.05017.95
5.5.290.0000.06017.92
5.5.280.0400.04320.87
5.5.270.0100.04020.76
5.5.260.0170.07320.75
5.5.250.0100.03320.61
5.5.240.0170.07020.17
5.4.450.0630.05319.32
5.4.440.0800.04719.40
5.4.430.0200.04319.52
5.4.420.0630.00019.45
5.4.410.0630.00019.19
5.4.400.0700.00019.38
5.4.390.0630.00018.92
5.4.380.0770.00019.19
5.4.370.0630.00018.95
5.4.360.0600.00019.08
5.4.350.0630.00018.94
5.4.340.0080.03611.97
5.4.320.0070.03712.45
5.4.310.0060.03912.45
5.4.300.0050.03712.45
5.4.290.0090.03412.45
5.4.280.0070.03412.35
5.4.270.0050.03712.34
5.4.260.0040.04012.34
5.4.250.0060.03812.34
5.4.240.0110.03112.34
5.4.230.0060.03712.34
5.4.220.0060.03612.34
5.4.210.0050.03612.34
5.4.200.0070.03812.34
5.4.190.0050.03712.33
5.4.180.0100.03312.33
5.4.170.0060.03712.35
5.4.160.0100.03212.34
5.4.150.0100.03512.34
5.4.140.0090.03512.02
5.4.130.0040.03712.01
5.4.120.0090.03211.96
5.4.110.0050.04111.96
5.4.100.0070.03711.96
5.4.90.0090.03511.96
5.4.80.0090.03411.96
5.4.70.0100.03311.96
5.4.60.0070.03411.96
5.4.50.0060.03611.96
5.4.40.0080.03211.95
5.4.30.0080.03411.95
5.4.20.0080.04411.94
5.4.10.0060.04111.95
5.4.00.0050.04611.43
5.3.290.0080.04412.80
5.3.280.0090.03812.71
5.3.270.0070.03812.72
5.3.260.0060.04212.72
5.3.250.0050.03712.72
5.3.240.0040.03912.72
5.3.230.0060.03812.70
5.3.220.0070.03512.68
5.3.210.0040.04112.68
5.3.200.0060.03612.68
5.3.190.0060.03912.68
5.3.180.0040.04012.67
5.3.170.0060.03712.67
5.3.160.0060.03612.68
5.3.150.0090.03412.68
5.3.140.0100.03212.66
5.3.130.0090.03612.66
5.3.120.0060.04012.66
5.3.110.0060.04312.66
5.3.100.0100.03712.12
5.3.90.0080.03412.09
5.3.80.0060.03512.08
5.3.70.0070.03412.08
5.3.60.0080.03312.06
5.3.50.0100.03212.00
5.3.40.0050.03712.00
5.3.30.0060.03411.95
5.3.20.0050.03511.72
5.3.10.0070.03311.69
5.3.00.0060.03511.68
5.2.170.0110.0329.18
5.2.160.0070.0299.18
5.2.150.0050.0309.18
5.2.140.0070.0309.18
5.2.130.0040.0299.14
5.2.120.0060.0299.14
5.2.110.0050.0289.14
5.2.100.0080.0259.14
5.2.90.0030.0309.14
5.2.80.0060.0349.13
5.2.70.0050.0309.13
5.2.60.0040.0319.09
5.2.50.0030.0329.05
5.2.40.0080.0269.04
5.2.30.0030.0319.01
5.2.20.0030.0319.00
5.2.10.0070.0268.91
5.2.00.0060.0278.78
5.1.60.0030.0258.06
5.1.50.0070.0218.06
5.1.40.0040.0268.04
5.1.30.0040.0268.39
5.1.20.0030.0278.41
5.1.10.0090.0218.14
5.1.00.0030.0278.13
5.0.50.0030.0206.61
5.0.40.0040.0206.48
5.0.30.0060.0316.29
5.0.20.0050.0206.26
5.0.10.0060.0196.24
5.0.00.0050.0346.23
4.4.90.0050.0194.78
4.4.80.0040.0154.75
4.4.70.0010.0174.75
4.4.60.0030.0154.75
4.4.50.0030.0184.77
4.4.40.0060.0304.71
4.4.30.0050.0154.76
4.4.20.0030.0164.84
4.4.10.0010.0184.85
4.4.00.0020.0264.76
4.3.110.0040.0144.67
4.3.100.0020.0154.66
4.3.90.0030.0144.63
4.3.80.0030.0244.59
4.3.70.0040.0134.63
4.3.60.0030.0154.63
4.3.50.0020.0174.63
4.3.40.0050.0224.54
4.3.30.0030.0153.28
4.3.20.0030.0153.26
4.3.10.0020.0163.22
4.3.00.0170.0176.86

preferences:
47.12 ms | 401 KiB | 5 Q