3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'value 12; another value; yet one more one; val5'; $src = ["value 12", "another value", "yet one more one", "val5"]; $tgt = ["red","green","blue","violet"]; $res = str_replace($src, $tgt, $str); echo $res;

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.4.120.0130.00620.28
8.4.110.0110.00818.75
8.4.100.0100.01117.60
8.4.90.0120.00817.81
8.4.80.0120.00519.37
8.4.70.0020.00617.53
8.4.60.0130.00819.27
8.4.50.0070.00318.60
8.4.40.0080.00817.59
8.4.30.0130.00320.69
8.4.20.0040.00417.77
8.4.10.0100.00624.08
8.3.250.0080.01216.96
8.3.240.0100.00716.39
8.3.230.0130.00616.44
8.3.220.0120.00619.03
8.3.210.0090.01016.36
8.3.200.0140.00518.60
8.3.190.0040.00417.10
8.3.180.0130.00717.14
8.3.170.0090.00920.53
8.3.160.0200.00016.49
8.3.150.0150.00416.98
8.3.140.0090.00916.54
8.3.130.0040.00416.10
8.3.120.0080.00318.64
8.3.110.0040.00416.41
8.3.100.0050.00324.06
8.3.90.0090.00926.77
8.3.80.0060.00318.18
8.3.70.0070.01116.63
8.3.60.0090.00618.20
8.3.50.0070.01020.09
8.3.40.0110.00420.33
8.3.30.0120.00318.71
8.3.20.0040.00424.18
8.3.10.0060.00324.66
8.3.00.0070.00026.16
8.2.290.0090.01218.90
8.2.280.0150.00816.78
8.2.270.0130.00716.85
8.2.260.0100.00716.63
8.2.250.0080.00018.02
8.2.240.0060.00317.00
8.2.230.0100.00320.94
8.2.220.0030.00637.54
8.2.210.0080.00026.77
8.2.200.0050.00316.50
8.2.190.0070.01116.63
8.2.180.0070.00725.92
8.2.170.0130.00318.84
8.2.160.0070.00722.96
8.2.150.0050.00225.66
8.2.140.0060.00324.66
8.2.130.0000.00826.16
8.2.120.0020.00526.16
8.2.110.0100.00020.52
8.2.100.0080.00417.74
8.2.90.0040.00417.84
8.2.80.0080.00019.36
8.2.70.0060.00317.63
8.2.60.0040.00417.90
8.2.50.0060.00318.07
8.2.40.0030.00618.29
8.2.30.0030.00618.11
8.2.20.0050.00219.21
8.2.10.0040.00418.03
8.2.00.0000.00719.17
8.1.330.0110.00715.97
8.1.320.0050.00516.12
8.1.310.0000.01416.84
8.1.300.0090.00019.88
8.1.290.0030.00630.84
8.1.280.0120.00325.92
8.1.270.0040.00424.66
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0000.00922.61
8.1.230.0070.00420.96
8.1.220.0080.00017.74
8.1.210.0060.00318.80
8.1.200.0030.00617.13
8.1.190.0040.00417.23
8.1.180.0030.00618.10
8.1.170.0000.00818.91
8.1.160.0080.00018.87
8.1.150.0000.00818.63
8.1.140.0040.00417.38
8.1.130.0000.00718.82
8.1.120.0120.00417.31
8.1.110.0050.01117.27
8.1.100.0110.00517.42
8.1.90.0110.00517.22
8.1.80.0130.00317.22
8.1.70.0140.00317.23
8.1.60.0060.01317.48
8.1.50.0090.00917.40
8.1.40.0150.00317.33
8.1.30.0120.00617.43
8.1.20.0090.00917.56
8.1.10.0080.00317.41
8.1.00.0100.00017.44
8.0.300.0040.00420.04
8.0.290.0030.00316.75
8.0.280.0040.00418.36
8.0.270.0000.00717.25
8.0.260.0040.00418.34
8.0.250.0080.00016.97
8.0.240.0130.00316.90
8.0.230.0040.00816.74
8.0.220.0030.00916.85
8.0.210.0150.00016.84
8.0.200.0110.00416.71
8.0.190.0080.00816.89
8.0.180.0130.00316.81
8.0.170.0090.00616.74
8.0.160.0130.00216.78
8.0.150.0100.00716.71
8.0.140.0150.00016.68
8.0.130.0150.00016.81
8.0.120.0050.01016.84
8.0.110.0140.00016.82
8.0.100.0070.00716.64
8.0.90.0060.00816.77
8.0.80.0130.00316.79
8.0.70.0100.00516.75
8.0.60.0150.00016.63
8.0.50.0140.00016.77
8.0.30.0120.00316.79
8.0.20.0130.00316.69
8.0.10.0080.00816.93
7.4.330.0000.00515.55
7.4.320.0080.00816.38
7.4.300.0100.00316.53
7.4.290.0100.00516.52
7.4.280.0170.00016.54
7.4.270.0040.01216.41
7.4.260.0120.00616.38
7.4.250.0140.00016.52
7.4.240.0080.00016.44
7.4.230.0040.00716.43
7.4.220.0080.00816.47
7.4.210.0090.00316.34
7.4.200.0100.00516.38
7.4.190.0150.00016.48
7.4.180.0110.00416.44
7.4.160.0120.00316.57
7.4.150.0100.00516.45
7.4.140.0070.00716.35
7.4.130.0090.00416.36
7.4.120.0090.00416.25
7.4.110.0150.00016.39
7.4.100.0140.00016.43
7.4.90.0120.00316.29
7.4.80.0090.00516.36
7.4.70.0140.00016.30
7.4.60.0090.00616.48
7.4.50.0050.00516.17
7.4.40.0030.00816.20
7.4.30.0100.00416.49
7.4.20.0040.00916.43
7.4.10.0080.00516.38
7.4.00.0130.00016.40

preferences:
28.46 ms | 403 KiB | 5 Q