3v4l.org

run code in 300+ PHP versions simultaneously
<?php //$str = file_get_contents("file.csv"); $str = "sku,is_in_stock,warehouse_3,warehouse_4 AP-STYLUS,0,20,5 RC-3049,0,0,0 NFNC-FLAT-CAP,0,20,20 NFNC-HOOD14-ZIP-S,1,0,5"; $arr = explode("\n", $str); $result = array(); Foreach($arr as $line){ $linearr = explode(",", $line); If(is_numeric($linearr[2])){ if($linearr[2]+$linearr[3]>=1){ $linearr[1]="1"; $line = implode("," , $linearr); }else{ $linearr[1]="0"; $line = implode("," , $linearr); } } $result[]=$line; } $newstr = implode("\n", $result); //put_file_contents("file.csv", $newstr); Echo $newstr;

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.20.0030.01317.72
8.4.10.0030.01717.86
8.3.140.0030.00618.32
8.3.130.0130.01018.28
8.3.120.0060.00319.01
8.3.110.0040.00416.61
8.3.100.0040.00416.52
8.3.90.0080.00018.33
8.3.80.0070.00317.97
8.3.70.0120.00616.50
8.3.60.0120.00316.46
8.3.50.0140.00421.98
8.3.40.0190.00018.74
8.3.30.0080.00818.84
8.3.20.0070.00020.34
8.3.10.0080.00021.76
8.3.00.0030.00917.91
8.2.260.0100.00016.67
8.2.250.0090.00618.43
8.2.240.0040.00418.78
8.2.230.0060.00320.94
8.2.220.0060.00337.54
8.2.210.0000.00826.77
8.2.200.0030.00616.63
8.2.190.0110.00416.75
8.2.180.0070.01418.41
8.2.170.0170.00322.96
8.2.160.0030.01019.16
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0050.00219.35
8.2.110.0180.00320.35
8.2.100.0060.00617.93
8.2.90.0000.00819.34
8.2.80.0090.00017.97
8.2.70.0040.00417.63
8.2.60.0050.00517.68
8.2.50.0040.00418.10
8.2.40.0000.00822.32
8.2.30.0000.00719.31
8.2.20.0040.00417.79
8.2.10.0000.00718.03
8.2.00.0040.00418.16
8.1.310.0060.00916.57
8.1.300.0070.01118.55
8.1.290.0060.00318.88
8.1.280.0150.00025.92
8.1.270.0050.00223.79
8.1.260.0060.00326.35
8.1.250.0070.00028.09
8.1.240.0060.00324.00
8.1.230.0080.00417.45
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0100.00317.48
8.1.190.0000.00817.35
8.1.180.0060.00318.10
8.1.170.0080.00018.71
8.1.160.0000.00722.10
8.1.150.0050.00318.81
8.1.140.0040.00419.71
8.1.130.0030.00317.70
8.1.120.0000.00717.50
8.1.110.0000.00917.39
8.1.100.0000.00717.39
8.1.90.0040.00417.37
8.1.80.0030.00617.39
8.1.70.0030.00317.50
8.1.60.0090.00017.49
8.1.50.0030.00617.56
8.1.40.0040.00417.41
8.1.30.0050.00317.61
8.1.20.0000.00817.54
8.1.10.0030.00517.55
8.1.00.0040.00417.40
8.0.300.0000.00818.77
8.0.290.0030.00516.75
8.0.280.0000.00718.50
8.0.270.0070.00017.26
8.0.260.0050.00217.30
8.0.250.0070.00017.02
8.0.240.0040.00416.95
8.0.230.0000.00717.01
8.0.220.0030.00416.85
8.0.210.0030.00316.97
8.0.200.0040.00416.89
8.0.190.0000.00716.98
8.0.180.0060.00316.98
8.0.170.0030.00516.93
8.0.160.0070.00016.96
8.0.150.0030.00316.90
8.0.140.0060.00316.85
8.0.130.0060.00013.34
8.0.120.0040.00416.83
8.0.110.0040.00416.84
8.0.100.0070.00016.81
8.0.90.0070.00017.00
8.0.80.0090.00616.90
8.0.70.0050.00316.76
8.0.60.0040.00416.95
8.0.50.0000.00716.93
8.0.30.0060.01117.29
8.0.20.0130.00717.40
8.0.10.0000.00717.11
8.0.00.0100.01316.82
7.4.330.0050.00015.08
7.4.320.0030.00316.49
7.4.300.0060.00016.63
7.4.290.0000.00816.61
7.4.280.0040.00416.50
7.4.270.0040.00416.51
7.4.260.0000.00716.49
7.4.250.0030.00616.56
7.4.240.0050.00216.58
7.4.230.0050.00316.66
7.4.220.0060.01316.61
7.4.210.0110.00816.63
7.4.200.0040.00416.61
7.4.160.0050.01016.62
7.4.150.0150.00317.40
7.4.140.0050.01217.86
7.4.130.0100.00716.58
7.4.120.0060.01116.50
7.4.110.0030.01416.45
7.4.100.0110.00616.52
7.4.90.0040.01516.43
7.4.80.0060.01019.39
7.4.70.0090.01216.49
7.4.60.0130.00316.52
7.4.50.0070.00716.51
7.4.40.0070.01016.69
7.4.30.0070.01016.64
7.4.00.0100.00614.69
7.3.330.0000.00513.22
7.3.320.0000.00513.16
7.3.310.0050.00216.19
7.3.300.0030.00316.33
7.3.290.0000.00716.30
7.3.280.0090.00916.35
7.3.270.0080.00817.40
7.3.260.0130.00516.38
7.3.250.0090.00916.34
7.3.240.0100.00816.48
7.3.230.0030.01416.53
7.3.210.0180.00616.64
7.3.200.0070.01416.47
7.3.190.0120.00616.46
7.3.180.0060.01516.44
7.3.170.0090.00916.54
7.3.160.0100.00716.34
7.3.120.0110.00715.04
7.3.110.0030.01314.52
7.3.100.0040.01115.00
7.3.90.0030.01714.80
7.3.80.0120.00415.01
7.3.70.0070.00714.80
7.3.60.0090.00614.99
7.3.50.0070.00714.69
7.3.40.0080.00414.58
7.3.30.0040.01114.64
7.3.20.0000.01516.77
7.3.10.0110.00416.70
7.3.00.0000.00916.53
7.2.330.0060.01116.50
7.2.320.0030.01416.69
7.2.310.0110.00516.74
7.2.300.0060.01016.55
7.2.290.0100.00716.63
7.2.250.0120.00615.02
7.2.240.0120.00815.02
7.2.230.0070.00315.24
7.2.220.0150.00315.26
7.2.210.0000.01215.22
7.2.200.0070.01014.88
7.2.190.0060.00614.95
7.2.180.0000.01315.18
7.2.170.0110.00314.98
7.2.60.0030.01316.63
7.2.00.0000.01118.90
7.1.330.0090.00615.94
7.1.320.0060.00616.00
7.1.310.0100.00315.95
7.1.300.0060.00615.84
7.1.290.0100.00315.67
7.1.280.0100.00715.64
7.1.270.0100.00715.97
7.1.260.0030.01015.95
7.1.200.0070.00415.63
7.1.70.0030.00617.06
7.1.60.0200.00019.87
7.1.00.0070.07322.35
7.0.200.0280.00714.98
7.0.100.0270.07319.95
7.0.90.0070.08019.91
7.0.80.0100.08319.95
7.0.70.0130.04720.16
7.0.60.0130.07319.99
7.0.50.0130.07720.32
7.0.40.0170.07720.10
7.0.30.0070.06319.95
7.0.20.0170.06720.18
7.0.10.0100.09320.07
7.0.00.0130.08320.12
5.6.280.0070.07021.02
5.6.250.0100.04720.77
5.6.240.0070.08320.70
5.6.230.0100.06020.71
5.6.220.0030.05020.65
5.6.210.0130.07020.52
5.6.200.0030.08321.06
5.6.190.0100.07021.07
5.6.180.0070.08321.06
5.6.170.0130.04021.01
5.6.160.0100.07720.93
5.6.150.0100.07721.02
5.6.140.0100.08021.09
5.6.130.0170.04020.93
5.6.120.0030.05721.16
5.6.110.0230.07021.07
5.6.100.0100.08320.99
5.6.90.0170.07020.92
5.6.80.0170.07720.39
5.6.70.0100.04720.48
5.6.60.0100.06720.39
5.6.50.0030.08320.51
5.6.40.0030.07320.38
5.6.30.0130.04720.31
5.6.20.0170.07020.36
5.6.10.0100.04720.34
5.6.00.0070.08720.27
5.5.380.0100.06020.54
5.5.370.0130.06320.37
5.5.360.0100.08020.35
5.5.350.0070.07020.41
5.5.340.0070.08720.78
5.5.330.0130.07320.64
5.5.320.0030.06720.87
5.5.310.0000.06320.88
5.5.300.0170.06320.75
5.5.290.0070.08720.85
5.5.280.0000.04720.85
5.5.270.0100.07320.90
5.5.260.0070.08320.82
5.5.250.0030.05720.63
5.5.240.0000.08320.15
5.5.230.0100.07020.27
5.5.220.0130.03720.20
5.5.210.0130.07020.27
5.5.200.0100.08020.28
5.5.190.0100.07720.17
5.5.180.0070.08320.23
5.5.160.0100.05320.18
5.5.150.0130.07320.07
5.5.140.0130.06320.17
5.5.130.0030.06320.21
5.5.120.0100.08320.14
5.5.110.0130.07020.18
5.5.100.0170.07020.11
5.5.90.0100.04320.00
5.5.80.0130.07020.11
5.5.70.0130.07720.00
5.5.60.0070.04320.15
5.5.50.0070.07020.08
5.5.40.0030.07720.10
5.5.30.0070.06720.12
5.5.20.0100.04720.10
5.5.10.0000.04319.98
5.5.00.0100.08020.07

preferences:
77.54 ms | 403 KiB | 5 Q