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 { public $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.70.0100.01016.50
8.3.60.0100.01016.75
8.3.50.0090.01321.92
8.3.40.0110.00418.84
8.3.30.0140.00018.58
8.3.20.0000.00720.34
8.3.10.0040.00423.54
8.3.00.0080.00019.26
8.2.180.0180.00318.29
8.2.170.0040.01122.96
8.2.160.0110.00420.51
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0040.00417.63
8.2.120.0030.00526.35
8.2.110.0060.00319.34
8.2.100.0080.00417.72
8.2.90.0040.00419.12
8.2.80.0080.00017.97
8.2.70.0030.00717.38
8.2.60.0000.00917.90
8.2.50.0030.00618.07
8.2.40.0000.00719.06
8.2.30.0070.00020.53
8.2.20.0060.00317.70
8.2.10.0040.00418.15
8.2.00.0040.00417.99
8.1.280.0130.00725.92
8.1.270.0090.00023.99
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0060.00323.92
8.1.230.0040.00717.45
8.1.220.0000.00817.76
8.1.210.0040.00418.77
8.1.200.0060.00317.23
8.1.190.0080.00017.23
8.1.180.0000.00918.10
8.1.170.0040.00418.35
8.1.160.0040.00421.97
8.1.150.0040.00418.73
8.1.140.0050.00319.56
8.1.130.0000.00717.63
8.1.120.0040.00417.46
8.1.110.0000.00717.46
8.1.100.0040.00417.31
8.1.90.0040.00417.42
8.1.80.0000.00717.43
8.1.70.0000.00717.22
8.1.60.0000.00817.50
8.1.50.0080.00017.62
8.1.40.0040.00817.54
8.1.30.0060.00617.68
8.1.20.0110.00017.64
8.1.10.0000.00817.48
8.1.00.0000.00717.55
8.0.300.0040.00418.77
8.0.290.0030.00616.75
8.0.280.0030.00318.42
8.0.270.0070.00017.22
8.0.260.0000.00617.13
8.0.250.0070.00017.00
8.0.240.0050.00317.06
8.0.230.0020.00516.96
8.0.220.0000.00716.86
8.0.210.0040.00416.99
8.0.200.0000.00616.98
8.0.190.0030.00516.88
8.0.180.0000.00816.93
8.0.170.0050.00316.93
8.0.160.0000.00717.00
8.0.150.0000.00716.83
8.0.140.0000.00716.77
8.0.130.0030.00313.34
8.0.120.0030.00516.82
8.0.110.0040.00416.86
8.0.100.0040.00416.75
8.0.90.0070.00016.82
8.0.80.0040.01116.97
8.0.70.0030.00616.79
8.0.60.0000.00816.94
8.0.50.0000.00716.98
8.0.30.0100.00817.15
8.0.20.0120.00917.40
8.0.10.0030.00516.99
8.0.00.0100.00916.78
7.4.330.0060.00016.79
7.4.320.0030.00316.48
7.4.300.0000.00616.52
7.4.290.0070.00016.53
7.4.280.0040.00416.44
7.4.270.0050.00316.48
7.4.260.0030.00316.66
7.4.250.0040.00416.64
7.4.240.0030.00516.60
7.4.230.0040.00416.63
7.4.220.0150.02016.54
7.4.210.0060.01316.71
7.4.200.0030.00316.61
7.4.160.0210.00316.50
7.4.150.0000.01717.40
7.4.140.0140.00817.86
7.4.130.0040.01616.55
7.4.120.0130.00416.64
7.4.110.0070.01016.52
7.4.100.0080.01616.37
7.4.90.0160.00616.73
7.4.80.0200.00019.39
7.4.70.0090.00916.48
7.4.60.0100.00716.38
7.4.50.0040.01116.45
7.4.40.0060.01016.52
7.4.30.0000.01616.42
7.4.00.0060.00614.66
7.3.330.0000.00513.26
7.3.320.0000.00613.40
7.3.310.0040.00416.38
7.3.300.0030.00316.25
7.3.290.0100.00716.38
7.3.280.0090.00916.36
7.3.270.0120.00617.40
7.3.260.0100.01016.31
7.3.250.0130.00916.42
7.3.240.0090.00916.43
7.3.230.0030.01316.57
7.3.210.0080.00916.33
7.3.200.0140.00416.44
7.3.190.0090.01416.45
7.3.180.0070.01016.52
7.3.170.0160.00016.60
7.3.160.0160.00016.27
7.2.330.0040.01516.43
7.2.320.0030.01716.64
7.2.310.0060.01216.59
7.2.300.0170.00416.44
7.2.290.0110.00816.50
7.2.60.0100.00316.88
7.2.00.0110.00519.41
7.1.200.0040.00715.70
7.1.70.0040.00417.21
7.1.60.0070.00317.13
7.1.50.0090.01216.88
7.1.00.0130.06322.24
7.0.200.0030.00716.75
7.0.60.0100.06020.06
7.0.50.0070.05017.86
7.0.40.0070.05020.10
7.0.30.0370.07720.25
7.0.20.0330.06020.20
7.0.10.0000.04720.09
7.0.00.0000.09020.22
5.6.280.0030.06021.14
5.6.210.0030.08320.51
5.6.200.0030.09018.16
5.6.190.0030.04320.55
5.6.180.0300.08020.64
5.6.170.0370.03720.47
5.6.160.0030.07720.55
5.6.150.0070.04718.24
5.6.140.0070.05718.25
5.6.130.0030.04318.17
5.6.120.0070.04321.16
5.6.110.0100.06721.01
5.6.100.0130.07021.13
5.6.90.0030.09020.99
5.6.80.0270.06320.31
5.5.350.0030.04020.32
5.5.340.0130.05018.02
5.5.330.0030.07020.32
5.5.320.0030.06720.38
5.5.310.0230.07720.37
5.5.300.0100.07717.98
5.5.290.0030.08017.94
5.5.280.0030.05320.75
5.5.270.0030.09020.80
5.5.260.0130.06020.80
5.5.250.0100.08320.64
5.5.240.0430.06020.25

preferences:
62.73 ms | 401 KiB | 5 Q