3v4l.org

run code in 300+ PHP versions simultaneously
<?php $testHeader = ['Mold SKU', 'Title', 'Category', 'Tags']; $testRows = []; $testRows[] = ['12MM-SM-SQ', '12mm Squares', 'Earings|Earings > Fishhooks','square']; $testRows[] = ['12MM-SQ-HOLLOW-DROP', 'Square Hollow Drop Studs', 'Earings|Earings > Studs','square']; $testRows[] = ['Example SKU', 'Example Title', 'Example|Sub|Whatever|category','tag1|tag2|tag3']; $testArray = [$testHeader, ...$testRows]; $fp = fopen('php://memory', 'w+'); foreach ($testArray as $testRow) { fputcsv($fp, $testRow); } rewind($fp); // ABOVE IS ONLY FOR TESTING HERE! ------------------------------------- // $fp = fopen($skufileurl, 'r'); // <-- you will use this! $termName = 'Example SKU'; $csvRows = []; $csvHeader = fgetcsv($fp); while ($csvRow = fgetcsv($fp)) { $keyedCsvRow = array_combine($csvHeader, $csvRow); if ($keyedCsvRow['Mold SKU'] === $termName) { $keyedCsvRow['Category'] = explode('|', $keyedCsvRow['Category']); $keyedCsvRow['Tags'] = explode('|', $keyedCsvRow['Tags']); $finalArray = $keyedCsvRow; break; } } var_dump($finalArray);

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.140.0170.00517.75
8.4.130.0130.00718.89
8.4.120.0140.00524.09
8.4.110.0140.00620.66
8.4.100.0140.00618.70
8.4.90.0100.01020.53
8.4.80.0100.00918.80
8.4.70.0120.01017.95
8.4.60.0070.00218.52
8.4.50.0080.00818.70
8.4.40.0100.01017.68
8.4.30.0100.01020.51
8.4.20.0070.01317.79
8.4.10.0040.00420.48
8.3.270.0090.01116.51
8.3.260.0110.01116.49
8.3.250.0110.00819.03
8.3.240.0110.00816.88
8.3.230.0060.01016.45
8.3.220.0130.00519.13
8.3.210.0080.01218.50
8.3.200.0040.00516.81
8.3.190.0030.00617.34
8.3.180.0160.00416.57
8.3.170.0120.00618.84
8.3.160.0040.00420.16
8.3.150.0040.01216.63
8.3.140.0040.00418.80
8.3.130.0070.00318.70
8.3.120.0100.00019.18
8.3.110.0070.00720.94
8.3.100.0000.01024.06
8.3.90.0080.00026.77
8.3.80.0060.00316.63
8.3.70.0090.00916.63
8.3.60.0070.01016.75
8.3.50.0090.00824.45
8.3.40.0100.00718.59
8.3.30.0130.00618.68
8.3.20.0040.00424.18
8.3.10.0000.00824.66
8.3.00.0060.00326.16
8.2.290.0110.00820.34
8.2.280.0100.00820.32
8.2.270.0150.00419.20
8.2.260.0070.00316.64
8.2.250.0060.00316.61
8.2.240.0060.00317.13
8.2.230.0080.01122.58
8.2.220.0030.00737.54
8.2.210.0170.00026.77
8.2.200.0060.00316.38
8.2.190.0070.00716.58
8.2.180.0150.00025.92
8.2.170.0090.00919.09
8.2.160.0030.01022.96
8.2.150.0060.00325.66
8.2.140.0000.00824.66
8.2.130.0060.00326.16
8.2.120.0080.00026.35
8.2.110.0070.01120.99
8.2.100.0070.00717.88
8.2.90.0030.00518.22
8.2.80.0050.00317.97
8.2.70.0000.00817.50
8.2.60.0000.00917.63
8.2.50.0050.00518.05
8.2.40.0050.00318.22
8.2.30.0000.00718.13
8.2.20.0000.00818.10
8.2.10.0040.00419.36
8.2.00.0040.00419.31
8.1.330.0110.00921.99
8.1.320.0160.00616.36
8.1.310.0040.01318.34
8.1.300.0080.00018.61
8.1.290.0070.00330.84
8.1.280.0100.00725.92
8.1.270.0040.00423.99
8.1.260.0000.00828.09
8.1.250.0050.00328.09
8.1.240.0060.00322.20
8.1.230.0000.01122.61
8.1.220.0090.00017.76
8.1.210.0030.00620.03
8.1.200.0030.00617.66
8.1.190.0030.00517.35
8.1.180.0060.00318.10
8.1.170.0090.00018.71
8.1.160.0030.00618.80
8.1.150.0040.00418.79
8.1.140.0000.00818.80
8.1.130.0030.00520.14
8.1.120.0000.00817.38
8.1.110.0000.00817.47
8.1.100.0080.00017.42
8.1.90.0030.00517.46
8.1.80.0000.00717.45
8.1.70.0050.00317.50
8.1.60.0000.00817.63
8.1.50.0030.00717.48
8.1.40.0040.00417.56
8.1.30.0080.00017.57
8.1.20.0000.00917.69
8.1.10.0000.00817.59
8.1.00.0060.00617.42
8.0.300.0040.00420.14
8.0.290.0080.00016.75
8.0.280.0030.00318.54
8.0.270.0000.00718.01
8.0.260.0030.00520.07
8.0.250.0000.00716.93
8.0.240.0070.00016.94
8.0.230.0060.00316.86
8.0.220.0000.00716.89
8.0.210.0040.00416.93
8.0.200.0060.00316.88
8.0.190.0030.00516.93
8.0.180.0050.00216.91
8.0.170.0040.00417.03
8.0.160.0040.00416.96
8.0.150.0070.00016.92
8.0.140.0000.00716.80
8.0.130.0030.00313.38
8.0.120.0040.00416.86
8.0.110.0040.00416.91
8.0.100.0080.00016.79
8.0.90.0080.00016.75
8.0.80.0060.01016.86
8.0.70.0040.00416.93
8.0.60.0000.00716.88
8.0.50.0050.00316.95
8.0.30.0100.00717.26
8.0.20.0060.01417.06
8.0.10.0040.00416.98
8.0.00.0160.00316.59
7.4.330.0050.00015.55
7.4.320.0060.00016.51
7.4.300.0070.00016.55
7.4.290.0000.00716.45
7.4.280.0000.00716.66
7.4.270.0050.00516.36
7.4.260.0030.00313.16
7.4.250.0050.00216.54
7.4.240.0000.00716.63
7.4.230.0050.00216.63
7.4.220.0060.00116.40
7.4.210.0030.01316.51
7.4.200.0070.00016.60
7.4.130.0110.00816.47
7.4.120.0060.01316.63
7.4.110.0180.00716.38
7.4.100.0090.00916.63
7.4.90.0060.01316.34
7.4.80.0070.01316.40
7.4.70.0160.00316.21
7.4.60.0070.01316.27
7.4.50.0100.00816.19
7.4.40.0090.01616.16
7.4.30.0150.00616.19
7.4.20.0150.01016.27
7.4.10.0150.00816.29
7.4.00.0070.01516.57
7.3.330.0050.00316.26
7.3.320.0030.00513.15
7.3.310.0030.00516.14
7.3.300.0030.00316.16
7.3.290.0060.00916.22
7.3.260.0140.00716.48
7.3.230.0120.00416.16
7.3.210.0090.00916.25
7.3.200.0080.01016.08
7.3.190.0070.01016.09
7.3.180.0080.00816.10
7.3.170.0100.01016.03
7.3.160.0170.00516.03
7.3.150.0200.00016.03
7.3.140.0100.00715.80
7.3.130.0090.00816.10
7.3.120.0130.00716.02
7.3.110.0140.01216.24
7.3.100.0140.00716.23
7.3.90.0040.01316.07
7.3.80.0110.00716.09
7.3.70.0100.01016.22
7.3.60.0120.00616.10
7.3.50.0150.00615.97
7.3.40.0070.01116.13
7.3.30.0060.01316.16
7.3.20.0100.01016.15
7.3.10.0180.00315.98
7.3.00.0060.01315.96
7.2.330.0120.00616.33
7.2.320.0130.00516.30
7.2.310.0090.00916.25
7.2.300.0070.01616.16
7.2.290.0130.01015.97
7.2.280.0140.00416.10
7.2.270.0090.00916.12
7.2.260.0070.01116.15
7.2.250.0070.01516.01
7.2.240.0210.00516.16
7.2.230.0110.01316.19
7.2.220.0030.02216.52
7.2.210.0070.01116.10
7.2.200.0160.00316.12
7.2.190.0100.01016.23
7.2.180.0040.01516.14
7.2.170.0110.00816.25
7.2.160.0090.00916.27
7.2.150.0170.00716.19
7.2.140.0130.00616.32
7.2.130.0100.01016.26
7.2.120.0040.01916.30
7.2.110.0120.00916.36
7.2.100.0180.00316.27
7.2.90.0050.01516.27
7.2.80.0110.00816.08
7.2.70.0170.00316.40
7.2.60.0140.00816.13
7.2.50.0150.00916.24
7.2.40.0050.01616.48
7.2.30.0120.01016.50
7.2.20.0000.02016.18
7.2.10.0120.00916.18
7.2.00.0110.00716.13

preferences:
200.16 ms | 403 KiB | 5 Q