3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getCURL($url){ $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); return response; } class CSVParser { private $fsArrayColNames; private $fsArrayExtraCols; private $faArrayRecords; private $faArrayExtraRecords; public function getColTitles($includeExtra, &$colCount) { $result[] = $fsArrayColNames; $colCount = count($fsArrayColNames); if ($includeExtra){ array_merge($result,$fsArrayExtraCols); $colCount = $colCount + count($fsArrayExtraCols); } return result; } public function addExtraCols($namesArray){ array_merge($fsArrayExtraCols,$namesArray); $extraCount = count($namesArray); $cnt = count($faArrayExtraRecords); $append = array_fill(0,$cnt,""); for ($i0 = 0; $i0 < $cnt; ++$i0) { array_merge($faArrayExtraRecords[$i0],$append); } } public function getRowCount() { return count($faArrayRecords); } public function getOrSetValue($recordID, $col, $value, $isExtra, $isSet){ if ($isExtra){ if ($isSet) { $faArrayExtraRecords[$recordID][$col]=$value; } else { return $faArrayExtraRecords[$recordID][$col]; } } else { if ($isSet) { $faArrayRecords[$recordID][$col]=$value; } else { return $faArrayRecords[$recordID][$col]; } } } public function parseCSV($source){ $lines = explode($source,"\n"); $once = false; $count = 0; foreach($lines as $line) { $lineArray = explode($line,","); if (once) { array_merge( $faArrayRecords[$count], $lineArray ); } else { $fsArrayColNames = $lineArray; $once = true; } $count = $count++; } } public function parseFromURL($url) { return $this->parseCSV(getCURL($url)); } } $p = new CSVParser(); $url="http://pastebin.com/raw.php?i=vu81DjnS"; $p->parseFromURL($url); echo $p->fsArrayColNames;

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.3.40.0090.00618.84
8.3.30.0090.00618.84
8.3.20.0040.00420.21
8.3.10.0040.00423.61
8.3.00.0040.00419.38
8.2.170.0120.00822.96
8.2.160.0040.01120.57
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0080.00017.50
8.2.120.0020.00526.35
8.2.110.0060.00319.45
8.2.100.0000.01117.91
8.2.90.0000.00919.16
8.2.80.0040.00417.97
8.2.70.0050.00517.63
8.2.60.0080.00017.80
8.2.50.0000.00818.07
8.2.40.0000.00719.32
8.2.30.0070.00020.65
8.2.20.0000.00917.76
8.2.10.0000.00818.09
8.2.00.0060.00317.96
8.1.270.0040.00824.01
8.1.260.0070.00028.09
8.1.250.0040.00428.09
8.1.240.0030.00623.97
8.1.230.0080.00317.42
8.1.220.0030.00517.75
8.1.210.0040.00418.77
8.1.200.0030.00617.23
8.1.190.0040.00417.23
8.1.180.0060.00318.10
8.1.170.0040.00418.57
8.1.160.0040.00421.90
8.1.150.0000.00718.87
8.1.140.0040.00419.61
8.1.130.0000.00717.63
8.1.120.0050.00217.41
8.1.110.0030.00417.50
8.1.100.0040.00417.47
8.1.90.0040.00417.44
8.1.80.0040.00417.45
8.1.70.0000.00717.41
8.1.60.0040.00417.62
8.1.50.0030.00517.57
8.1.40.0040.00717.45
8.1.30.0080.00417.71
8.1.20.0030.00517.77
8.1.10.0060.00317.59
8.1.00.0040.00417.52
8.0.300.0040.00418.77
8.0.290.0050.00316.75
8.0.280.0000.00718.46
8.0.270.0040.00317.14
8.0.260.0060.00017.17
8.0.250.0070.00017.05
8.0.240.0070.00016.88
8.0.230.0070.00016.99
8.0.220.0030.00316.80
8.0.210.0030.00316.93
8.0.200.0030.00316.85
8.0.190.0080.00016.86
8.0.180.0050.00316.84
8.0.170.0030.00517.01
8.0.160.0050.00216.86
8.0.150.0050.00416.84
8.0.140.0000.00716.85
8.0.130.0050.00013.31
8.0.120.0000.00816.95
8.0.110.0000.00816.92
8.0.100.0000.00716.99
8.0.90.0040.00416.82
8.0.80.0060.01016.91
8.0.70.0050.00316.88
8.0.60.0000.00716.75
8.0.50.0030.00516.94
8.0.30.0120.00617.22
8.0.20.0120.01017.40
8.0.10.0030.00517.12
8.0.00.0060.01216.76
7.4.330.0000.00516.74
7.4.320.0030.00316.56
7.4.300.0030.00316.44
7.4.290.0040.00416.43
7.4.280.0000.00816.54
7.4.270.0000.00716.55
7.4.260.0030.00316.60
7.4.250.0030.00316.36
7.4.240.0050.00216.63
7.4.230.0070.00016.61
7.4.220.0220.00016.67
7.4.210.0060.01316.52
7.4.200.0030.00316.44
7.4.160.0030.01316.50
7.4.150.0070.01017.40
7.4.140.0110.01117.86
7.4.130.0120.00916.64
7.4.120.0070.01116.45
7.4.110.0070.01016.48
7.4.100.0120.01016.61
7.4.90.0040.01516.56
7.4.80.0060.01319.39
7.4.70.0000.01516.48
7.4.60.0070.01016.50
7.4.50.0030.00916.45
7.4.40.0150.00316.41
7.4.30.0060.01216.44
7.4.00.0070.01214.95
7.3.330.0050.00013.41
7.3.320.0000.00513.21
7.3.310.0000.00716.41
7.3.300.0030.00316.29
7.3.290.0080.00616.38
7.3.280.0090.00916.41
7.3.270.0180.00717.40
7.3.260.0100.00716.66
7.3.250.0090.01216.55
7.3.240.0120.00716.64
7.3.230.0070.01016.39
7.3.210.0080.00816.68
7.3.200.0100.01316.64
7.3.190.0100.01316.39
7.3.180.0090.00916.45
7.3.170.0040.01816.41
7.3.160.0060.00916.55
7.3.120.0110.00814.85
7.3.110.0060.01114.73
7.3.100.0070.00714.61
7.3.90.0070.00714.88
7.3.80.0180.00014.93
7.3.70.0000.01514.71
7.3.60.0070.01014.82
7.3.50.0070.00714.70
7.3.40.0110.00414.76
7.3.30.0060.00314.89
7.3.20.0040.00416.50
7.3.10.0000.00916.70
7.3.00.0030.00716.72
7.2.330.0100.01316.51
7.2.320.0060.01216.27
7.2.310.0120.00916.63
7.2.300.0090.00916.51
7.2.290.0280.02216.43
7.2.250.0130.00715.13
7.2.240.0100.01014.98
7.2.230.0030.00715.20
7.2.220.0000.01214.91
7.2.210.0000.01614.98
7.2.200.0100.00714.80
7.2.190.0110.00715.15
7.2.180.0030.01415.17
7.2.170.0130.00314.95
7.2.60.0030.01316.83
7.2.00.0030.01219.34
7.1.330.0000.01515.61
7.1.320.0030.00915.71
7.1.310.0150.00015.56
7.1.300.0040.00815.61
7.1.290.0070.00715.45
7.1.280.0070.01015.41
7.1.270.0040.00815.61
7.1.260.0100.00315.68
7.1.200.0120.00015.56
7.1.100.0120.00018.23
7.1.70.0000.00717.10
7.1.60.0120.01219.48
7.1.50.0060.01316.84
7.1.00.0000.08022.43
7.0.200.0260.01314.52
7.0.60.0130.08320.11
7.0.50.0130.05317.99
7.0.40.0070.08020.26
7.0.30.0400.05720.33
7.0.20.0400.07720.19
7.0.10.0130.03720.16
7.0.00.0070.05320.22
5.6.280.0030.06321.09
5.6.210.0170.07320.49
5.6.200.0200.02718.19
5.6.190.0070.04020.48
5.6.180.0230.04320.63
5.6.170.0170.06020.48
5.6.160.0000.04320.44
5.6.150.0070.08318.15
5.6.140.0070.04018.27
5.6.130.0100.06718.14
5.6.120.0130.07720.98
5.6.110.0170.08021.11
5.6.100.0100.03720.99
5.6.90.0170.07321.08
5.6.80.0130.07720.61
5.5.350.3000.03720.54
5.5.340.0130.07718.05
5.5.330.0100.07720.19
5.5.320.0030.03720.35
5.5.310.0200.07020.30
5.5.300.0070.03717.98
5.5.290.0100.07717.90
5.5.280.0130.07020.82
5.5.270.0030.05720.74
5.5.260.0070.05720.88
5.5.250.0100.07320.71
5.5.240.0270.06320.16

preferences:
57.15 ms | 400 KiB | 5 Q