3v4l.org

run code in 300+ PHP versions simultaneously
<?php function extractWantedStuff($input) { $output = []; $sections = explode('""', $input); $changeThisSection = false; foreach ($sections as $section) { if ($changeThisSection) { $section = str_replace(',', '', $section); } $output[] = $section; $changeThisSection = !$changeThisSection; } return implode('""', $output); } $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.00.0150.00619.92
8.4.150.0030.00014.05
8.4.140.0090.01217.42
8.4.130.0090.00718.49
8.4.120.0120.00624.09
8.4.110.0060.00918.07
8.4.100.0120.01018.80
8.4.90.0070.00420.45
8.4.80.0030.00418.75
8.4.70.0040.00417.89
8.4.60.0140.01019.01
8.4.50.0110.00918.92
8.4.40.0030.00519.33
8.4.30.0040.00420.60
8.4.20.0130.00719.77
8.4.10.0070.01022.16
8.3.280.0110.01218.38
8.3.270.0130.00716.86
8.3.260.0100.01016.57
8.3.250.0080.01018.66
8.3.240.0140.00517.07
8.3.230.0110.00816.50
8.3.220.0080.00618.90
8.3.210.0130.00516.68
8.3.200.0050.00416.52
8.3.190.0100.00817.24
8.3.180.0050.00316.62
8.3.170.0140.00420.76
8.3.160.0110.00417.13
8.3.150.0100.00717.47
8.3.140.0110.00716.57
8.3.130.0060.00318.64
8.3.120.0090.00018.97
8.3.110.0040.01220.94
8.3.100.0040.01224.06
8.3.90.0040.00426.77
8.3.80.0060.00316.63
8.3.70.0090.00616.58
8.3.60.0180.00318.36
8.3.50.0090.00620.14
8.3.40.0080.00818.66
8.3.30.0110.00319.39
8.3.20.0000.00724.18
8.3.10.0050.00224.66
8.3.00.0050.00526.16
8.2.290.0060.00220.21
8.2.280.0090.01018.51
8.2.270.0060.00316.77
8.2.260.0140.00320.56
8.2.250.0080.00816.57
8.2.240.0130.00617.13
8.2.230.0080.00022.58
8.2.220.0090.00637.54
8.2.210.0040.01126.77
8.2.200.0080.00316.75
8.2.190.0110.01116.58
8.2.180.0080.00825.92
8.2.170.0040.01118.95
8.2.160.0100.00322.96
8.2.150.0040.00425.66
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0000.00821.04
8.2.110.0090.00021.89
8.2.100.0000.01217.84
8.2.90.0000.00919.22
8.2.80.0100.00017.97
8.2.70.0000.00817.38
8.2.60.0000.00817.63
8.2.50.0000.00817.62
8.2.40.0040.00419.35
8.2.30.0040.00418.18
8.2.20.0040.00420.49
8.2.10.0000.00818.05
8.2.00.0000.01219.24
8.1.330.0150.00322.13
8.1.320.0060.00515.74
8.1.310.0090.00018.27
8.1.300.0100.00016.03
8.1.290.0040.00430.84
8.1.280.0080.00825.92
8.1.270.0030.00624.02
8.1.260.0050.00326.35
8.1.250.0000.00828.09
8.1.240.0080.00020.99
8.1.230.0040.00717.91
8.1.220.0040.00717.79
8.1.210.0000.00918.77
8.1.200.0050.00517.36
8.1.190.0040.00417.23
8.1.180.0060.00318.10
8.1.170.0000.00817.65
8.1.160.0040.00418.87
8.1.150.0000.00718.74
8.1.140.0090.00017.44
8.1.130.0070.00018.89
8.1.120.0040.00417.47
8.1.110.0030.00517.43
8.1.100.0040.00417.34
8.1.90.0000.00717.44
8.1.80.0040.00417.37
8.1.70.0000.00717.36
8.1.60.0000.00817.54
8.1.50.0210.00417.45
8.1.40.0150.00717.56
8.1.30.0150.00017.50
8.1.20.0150.00017.55
8.1.10.0160.00617.52
8.1.00.0290.00917.26
8.0.300.0080.00018.77
8.0.290.0070.00016.75
8.0.280.0040.00418.43
8.0.270.0000.00716.78
8.0.260.0000.00618.31
8.0.250.0040.00417.01
8.0.240.0000.00716.84
8.0.230.0030.00316.92
8.0.220.0040.00416.89
8.0.210.0050.00316.83
8.0.200.0060.00016.83
8.0.190.0000.00716.85
8.0.180.0080.00416.85
8.0.170.0060.00316.79
8.0.160.0060.00516.81
8.0.150.0060.00616.91
8.0.140.0000.00816.88
8.0.130.0000.00916.86
8.0.120.0040.00416.77
8.0.110.0120.00816.72
8.0.100.0100.01016.85
8.0.90.0140.00416.73
8.0.80.0150.00516.77
8.0.70.0190.00016.83
8.0.60.0120.00616.80
8.0.50.0150.00316.88
8.0.30.0150.00616.71
8.0.20.0060.00616.79
8.0.10.0140.00417.02
7.4.330.0020.00215.55
7.4.320.0030.00316.57
7.4.300.0030.00316.57
7.4.290.0140.01016.46
7.4.280.0120.01116.62
7.4.270.0190.00416.49
7.4.260.0160.00616.55
7.4.250.0180.00516.48
7.4.240.0140.00716.57
7.4.230.0110.00416.57
7.4.220.0080.00216.46
7.4.210.0150.00016.58
7.4.200.0160.00016.61
7.4.190.0150.00016.67
7.4.180.0070.00516.63
7.4.160.0050.00516.44
7.4.150.0060.00316.48
7.4.140.0110.00616.44
7.4.130.0160.00016.41
7.4.120.0130.00716.47
7.4.110.0090.00916.45
7.4.100.0110.00816.50
7.4.90.0030.00616.39
7.4.80.0110.00416.43
7.4.70.0140.00016.55
7.4.60.0180.00316.35
7.4.50.0100.00616.46
7.4.40.0090.00916.34
7.4.30.0060.00316.54
7.4.20.0080.00316.35
7.4.10.0000.01216.47
7.4.00.0000.01216.50

preferences:
30.64 ms | 403 KiB | 5 Q