3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = '<img src="data:image/png;base64,iVBORw0..="><img src="data:image/png;base64,iVBORw1..=">'; function deleteBase64_andReplace($start, $end, $replacement, $string) { $count = 0; $pattern = '|' . preg_quote($start, '|') . '(.*?)' . preg_quote($end, '|') . '|s'; while (strpos($string, $start) !== false) { return preg_replace_callback($pattern, function($m) use ($replacement, &$count) { return $replacement . ++$count;}, $string); } } $replacement = "image"; $stringResult= deleteBase64_andReplace("data:", "=", $replacement, $string); echo $stringResult;

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.5.10.0090.00818.61
8.5.00.0150.00620.14
8.4.150.0020.00014.05
8.4.140.0140.00917.85
8.4.130.0030.00618.68
8.4.120.0100.01024.17
8.4.110.0070.01218.86
8.4.100.0150.00618.77
8.4.90.0070.00222.57
8.4.80.0040.00518.67
8.4.70.0040.00518.84
8.4.60.0150.00720.66
8.4.50.0130.00818.70
8.4.40.0130.00719.59
8.4.30.0050.00320.60
8.4.20.0040.01219.65
8.4.10.0060.00322.17
8.3.280.0120.00818.73
8.3.270.0130.00616.88
8.3.260.0110.00916.75
8.3.250.0070.01118.88
8.3.240.0120.00617.15
8.3.230.0060.00316.88
8.3.220.0100.00718.88
8.3.210.0030.00416.96
8.3.200.0030.00516.86
8.3.190.0100.01017.20
8.3.180.0120.00716.73
8.3.170.0070.01116.85
8.3.160.0120.00917.04
8.3.150.0170.00717.59
8.3.140.0070.01120.55
8.3.130.0080.00018.66
8.3.120.0050.00519.05
8.3.110.0000.00820.94
8.3.100.0090.00016.72
8.3.90.0060.00316.86
8.3.80.0060.00318.80
8.3.70.0110.00418.65
8.3.60.0070.00716.88
8.3.50.0110.00420.40
8.3.40.0110.00419.14
8.3.30.0070.00719.52
8.3.20.0080.00024.18
8.3.10.0000.00824.66
8.3.00.0050.00326.16
8.2.290.0090.01020.28
8.2.280.0030.00718.66
8.2.270.0120.00616.95
8.2.260.0090.00317.06
8.2.250.0120.00318.45
8.2.240.0040.01518.79
8.2.230.0060.00322.58
8.2.220.0060.00324.06
8.2.210.0040.00426.77
8.2.200.0030.00716.63
8.2.190.0120.00918.41
8.2.180.0160.00025.92
8.2.170.0180.00418.73
8.2.160.0030.01022.96
8.2.150.0080.00025.66
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0040.00421.23
8.2.110.0040.00422.18
8.2.100.0120.00317.72
8.2.90.0050.00318.05
8.2.80.0030.00518.05
8.2.70.0000.00917.93
8.2.60.0080.00018.03
8.2.50.0040.00418.10
8.2.40.0030.00618.28
8.2.30.0000.00818.28
8.2.20.0000.00920.47
8.2.10.0000.00818.30
8.2.00.0080.00019.50
8.1.330.0130.00722.25
8.1.320.0050.00416.38
8.1.310.0070.01116.85
8.1.300.0060.00318.06
8.1.290.0080.00418.88
8.1.280.0120.00625.92
8.1.270.0000.00922.13
8.1.260.0000.00826.35
8.1.250.0060.00328.09
8.1.240.0070.00423.96
8.1.230.0070.00421.01
8.1.220.0040.00417.77
8.1.210.0050.00318.77
8.1.200.0060.00317.48
8.1.190.0080.00017.47
8.1.180.0050.00318.10
8.1.170.0040.00418.71
8.1.160.0050.00219.00
8.1.150.0030.00518.86
8.1.140.0050.00217.54
8.1.130.0040.00417.57
8.1.120.0040.00417.60
8.1.110.0070.00017.66
8.1.100.0000.00717.57
8.1.90.0000.00717.59
8.1.80.0000.01017.67
8.1.70.0070.00017.64
8.1.60.0300.00017.76
8.1.50.0230.00517.70
8.1.40.0250.00217.55
8.1.30.0250.00417.71
8.1.20.0210.00617.84
8.1.10.0190.00617.47
8.1.00.0280.00017.42
8.0.300.0000.00719.77
8.0.290.0040.00416.88
8.0.280.0030.00518.51
8.0.270.0040.00416.90
8.0.260.0000.00616.98
8.0.250.0030.00317.11
8.0.240.0000.00717.07
8.0.230.0000.00717.02
8.0.220.0000.00717.01
8.0.210.0040.00416.95
8.0.200.0040.00417.02
8.0.190.0180.00316.92
8.0.180.0250.00016.98
8.0.170.0160.00517.05
8.0.160.0140.00716.96
8.0.150.0170.00416.89
8.0.140.0130.00617.03
8.0.130.0140.00716.98
8.0.120.0160.00417.05
8.0.110.0160.00316.94
8.0.100.0160.00516.96
8.0.90.0140.00517.04
8.0.80.0150.00517.06
8.0.70.0170.00616.91
8.0.60.0210.00316.96
8.0.50.0240.00016.99
8.0.30.0170.00716.93
8.0.20.0250.00017.06
8.0.10.0210.00517.14
7.4.330.0050.00015.55
7.4.320.0060.00016.76
7.4.300.0000.00616.63
7.4.290.0190.00816.68
7.4.280.0240.00316.73
7.4.270.0160.01016.74
7.4.260.0270.00416.69
7.4.250.0310.00316.60
7.4.240.0180.01116.71
7.4.230.0210.00716.70
7.4.220.0190.00416.83
7.4.210.0130.01016.79
7.4.200.0230.00016.78
7.4.190.0210.00716.63
7.4.180.0170.00916.85
7.4.160.0210.00416.67
7.4.150.0130.01316.77
7.4.140.0170.00716.72
7.4.130.0160.00816.74
7.4.120.0170.00716.78
7.4.110.0160.00816.63
7.4.100.0110.00316.74
7.4.90.0130.00316.79
7.4.80.0090.00316.68
7.4.70.0070.00416.62
7.4.60.0070.00316.73
7.4.50.0030.00616.61
7.4.40.0090.00416.68
7.4.30.0060.00516.73
7.4.20.0080.00416.57
7.4.10.0050.00516.71
7.4.00.0070.00416.82

preferences:
37.26 ms | 403 KiB | 5 Q