3v4l.org

run code in 300+ PHP versions simultaneously
<?php function extractWantedStuff($string) { $sections = explode('""', $string); foreach ($sections as $key => $section) { if ($key % 2 != 0) { $sections[$key] = str_replace(',', '', $section); } } return implode('""', $sections); } $fullstring = ',""Word1, Word2"" and another thing ,""Word3, Word4""'; echo extractWantedStuff($fullstring);

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.0110.00718.75
8.5.00.0100.01320.04
8.4.160.0180.00522.25
8.4.150.0020.00014.05
8.4.140.0090.01217.71
8.4.130.0120.00517.82
8.4.120.0110.00823.96
8.4.110.0130.00717.76
8.4.100.0110.01019.13
8.4.90.0110.00819.16
8.4.80.0120.00817.90
8.4.70.0140.00817.71
8.4.60.0130.00618.57
8.4.50.0050.00418.73
8.4.40.0000.00819.32
8.4.30.0040.00420.43
8.4.20.0090.01119.58
8.4.10.0060.00322.38
8.3.280.0110.00918.31
8.3.270.0090.01116.52
8.3.260.0140.00516.51
8.3.250.0110.00718.95
8.3.240.0150.00518.99
8.3.230.0150.00516.48
8.3.220.0100.00817.41
8.3.210.0080.00716.57
8.3.200.0070.00216.40
8.3.190.0100.00817.05
8.3.180.0130.00716.79
8.3.170.0150.00316.48
8.3.160.0030.01418.51
8.3.150.0130.00617.15
8.3.140.0150.00319.01
8.3.130.0050.00318.59
8.3.120.0060.00319.01
8.3.110.0120.00820.94
8.3.100.0070.00416.56
8.3.90.0040.00426.77
8.3.80.0060.00316.50
8.3.70.0060.01316.58
8.3.60.0070.00716.50
8.3.50.0140.00020.14
8.3.40.0110.00418.50
8.3.30.0140.00019.35
8.3.20.0050.00324.18
8.3.10.0000.00724.66
8.3.00.0030.00626.16
8.2.290.0120.00520.29
8.2.280.0050.00318.65
8.2.270.0160.00316.63
8.2.260.0050.00318.44
8.2.250.0100.01016.66
8.2.240.0090.00017.08
8.2.230.0030.00722.58
8.2.220.0040.00424.06
8.2.210.0050.00226.77
8.2.200.0030.00718.41
8.2.190.0120.00618.33
8.2.180.0130.00725.92
8.2.170.0100.01419.04
8.2.160.0030.01022.96
8.2.150.0070.00025.66
8.2.140.0000.00724.66
8.2.130.0040.00426.16
8.2.120.0000.00826.16
8.2.110.0080.00421.06
8.2.100.0070.00317.78
8.2.90.0040.00419.63
8.2.80.0040.00417.97
8.2.70.0100.00017.75
8.2.60.0000.00818.03
8.2.50.0000.00918.07
8.2.40.0060.00318.16
8.2.30.0080.00018.00
8.2.20.0000.00720.45
8.2.10.0040.00418.00
8.2.00.0000.01019.12
8.1.330.0040.00423.91
8.1.320.0050.00416.33
8.1.310.0150.00418.34
8.1.300.0000.00917.80
8.1.290.0060.00630.84
8.1.280.0060.01025.92
8.1.270.0080.00023.99
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0060.00324.02
8.1.230.0040.00721.03
8.1.220.0000.00817.76
8.1.210.0050.00318.95
8.1.200.0030.00617.35
8.1.190.0040.00417.35
8.1.180.0080.00018.10
8.1.170.0070.00318.65
8.1.160.0030.00618.93
8.1.150.0000.00718.64
8.1.140.0040.00417.43
8.1.130.0030.00317.46
8.1.120.0080.00017.45
8.1.110.0040.00417.46
8.1.100.0040.00417.40
8.1.90.0050.00217.42
8.1.80.0000.00717.43
8.1.70.0030.00317.45
8.1.60.0000.00817.47
8.1.50.0040.00717.57
8.1.40.0080.00517.47
8.1.30.0030.01417.17
8.1.20.0120.00417.54
8.1.10.0120.00417.16
8.1.00.0090.00817.39
8.0.300.0030.00319.89
8.0.290.0060.00316.88
8.0.280.0030.00318.50
8.0.270.0030.00316.88
8.0.260.0070.00016.82
8.0.250.0030.00316.96
8.0.240.0030.00316.96
8.0.230.0070.00016.97
8.0.220.0000.00716.91
8.0.210.0070.00016.88
8.0.200.0030.00317.02
8.0.190.0070.00316.85
8.0.180.0100.00616.91
8.0.170.0140.00716.87
8.0.160.0140.00516.93
8.0.150.0210.00016.82
8.0.140.0170.00016.78
8.0.130.0000.01316.87
8.0.120.0090.00516.85
8.0.110.0080.00816.72
8.0.100.0110.00516.83
8.0.90.0060.01016.57
8.0.80.0130.00316.68
8.0.70.0100.00716.79
8.0.60.0070.00716.82
8.0.50.0070.00716.85
8.0.30.0060.01016.84
8.0.20.0170.00016.95
8.0.10.0190.00016.96
7.4.330.0050.00015.55
7.4.320.0060.00016.61
7.4.300.0060.00016.43
7.4.290.0000.00816.32
7.4.280.0000.01516.55
7.4.270.0220.01016.47
7.4.260.0120.00816.42
7.4.250.0170.00316.63
7.4.240.0100.00316.47
7.4.230.0170.00716.52
7.4.220.0190.00316.57
7.4.210.0160.00416.41
7.4.200.0170.00616.42
7.4.190.0070.00716.64
7.4.180.0110.00316.70
7.4.160.0110.00416.59
7.4.150.0200.00316.44
7.4.140.0160.00516.45
7.4.130.0170.00616.48
7.4.120.0230.00016.45
7.4.110.0130.00416.46
7.4.100.0070.00316.53
7.4.90.0120.00016.59
7.4.80.0080.00816.46
7.4.70.0120.00616.50
7.4.60.0200.00316.34
7.4.50.0170.00416.40
7.4.40.0150.00716.34
7.4.30.0200.00316.43
7.4.20.0170.00316.52
7.4.10.0180.00016.48
7.4.00.0060.01116.49

preferences:
38.93 ms | 403 KiB | 5 Q