3v4l.org

run code in 300+ PHP versions simultaneously
<?php $crlf = chr(13) . chr(10); $cr = chr(13); $delimiter = '|'; // 7 rows, 5th row has CR linebreak inside $lines = [ 'A', 'a', 'C15|C18|C21|C36|C42|C45|C48|C51|C54|C60|C63|C66|C69|C72|C75|C81|C84|C90|C93|C96|C99|C102|C105|C108|C111', '02-DEC-19|02-DEC-19|707403|GUEST|||PPPPPP||||||RR||||RRSSIAN||FFFF|||||+1111-11-11-111|', '02-DEC-19|02-DEC-19|707404|GUEST|SDDDDD|ВВВВВВВВВВВВ|PPPPPP|СССССС|ПППППП||01.01.1111|M|RR|ППППП|"ПППППППП кккк' . $cr . '"|MISSING LINE CONTENTS|', 'FF_FFFF|FF_1', '|1', ]; $csv = implode($crlf, $lines); $filePath = tempnam(sys_get_temp_dir(), 'csv'); file_put_contents($filePath, $csv); $file = new \SplFileObject($filePath, 'r'); $file->setFlags(SplFileObject::SKIP_EMPTY | SplFileObject::DROP_NEW_LINE | SplFileObject::READ_CSV); //ini_set('auto_detect_line_endings', true); $rows = []; while (!$file->eof()) { $row = $file->fgetcsv($delimiter, '"', "\0"); if ($row === null) { print_r("NULL result found though `SplFileObject::SKIP_EMPTY | SplFileObject::DROP_NEW_LINE` flags set.\n"); } else { $rows[] = implode($delimiter, $row); } } if (implode($crlf, $lines) !== implode($crlf, $rows)) { print_r("Error! Expected:\n"); print_r($lines); print_r("Parsed as:\n"); print_r($rows); } else { print_r("Passed."); }

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.60.0100.01718.25
8.3.50.0090.00618.24
8.3.40.0130.00719.14
8.3.30.0120.00318.82
8.3.20.0050.00320.85
8.3.10.0000.00820.31
8.3.00.0080.00022.46
8.2.180.0070.01416.63
8.2.170.0070.00722.96
8.2.160.0070.00722.27
8.2.150.0000.00824.18
8.2.140.0030.00624.66
8.2.130.0000.00926.16
8.2.120.0040.00426.16
8.2.110.0030.00619.20
8.2.100.0130.00018.22
8.2.90.0000.00817.88
8.2.80.0000.00818.86
8.2.70.0050.00517.38
8.2.60.0040.00517.63
8.2.50.0040.00418.10
8.2.40.0050.00319.46
8.2.30.0000.00719.44
8.2.20.0000.00818.30
8.2.10.0070.00019.34
8.2.00.0040.00419.51
8.1.280.0110.00425.92
8.1.270.0000.00822.65
8.1.260.0000.00726.35
8.1.250.0040.00428.09
8.1.240.0100.00722.42
8.1.230.0090.00321.04
8.1.220.0000.00918.59
8.1.210.0060.00319.04
8.1.200.0040.00417.36
8.1.190.0040.00416.97
8.1.180.0050.00319.09
8.1.170.0040.00418.66
8.1.160.0040.00418.98
8.1.150.0040.00418.89
8.1.140.0000.00723.86
8.1.130.0060.00320.24
8.1.120.0040.00417.35
8.1.110.0080.00017.56
8.1.100.0040.00417.55
8.1.90.0040.00417.50
8.1.80.0040.00417.51
8.1.70.0030.00317.51
8.1.60.0000.00817.52
8.1.50.0050.00317.55
8.1.40.0000.00917.45
8.1.30.0040.00417.71
8.1.20.0050.00317.54
8.1.10.0030.00517.59
8.1.00.0040.00417.61
8.0.300.0000.00920.01
8.0.290.0050.00516.88
8.0.280.0030.00318.46
8.0.270.0070.00016.87
8.0.260.0080.00020.17
8.0.250.0050.00317.02
8.0.240.0030.00316.89
8.0.230.0040.00416.91
8.0.220.0040.00416.94
8.0.210.0050.00316.78
8.0.200.0030.00316.90
8.0.190.0000.00716.98
8.0.180.0050.00317.02
8.0.170.0000.00816.99
8.0.160.0040.00416.95
8.0.150.0070.00016.89
8.0.140.0050.00516.83
8.0.130.0030.00313.45
8.0.120.0070.00016.77
8.0.110.0060.00316.96
8.0.100.0050.00216.94
8.0.90.0040.00416.92
8.0.80.0040.01516.95
8.0.70.0040.00416.96
8.0.60.0040.00417.02
8.0.50.0050.00316.95
8.0.30.0110.00717.02
8.0.20.0110.00917.18
8.0.10.0040.00416.99
8.0.00.0140.01016.82
7.4.330.0020.00215.55
7.4.320.0030.00316.49
7.4.300.0030.00316.68
7.4.290.0000.00716.55
7.4.280.0040.00416.66
7.4.270.0000.00716.59
7.4.260.0000.00513.28
7.4.250.0040.00416.53
7.4.240.0000.00716.56
7.4.230.0000.00716.54
7.4.220.0030.00316.66
7.4.210.0030.01316.69
7.4.200.0050.00316.45
7.4.130.0120.00616.39
7.4.120.0070.01116.46
7.4.110.0110.00816.62
7.4.100.0130.00716.63
7.4.90.0100.00716.57
7.4.80.0110.00619.39
7.4.70.0120.00916.66
7.4.60.0150.00316.60
7.4.50.0100.00716.38
7.4.40.0070.01016.53
7.4.10.0000.01516.69
7.4.00.0090.00415.79
7.3.330.0040.00416.31
7.3.320.0000.00613.29
7.3.310.0070.00016.38
7.3.300.0000.00716.29
7.3.290.0120.00616.41
7.3.280.0120.00316.34
7.3.260.0090.00916.39
7.3.240.0060.01216.41
7.3.230.0040.01616.20
7.3.210.0060.01216.56
7.3.200.0030.01416.29
7.3.190.0100.01316.51
7.3.180.0090.00916.70
7.3.170.0100.01016.26
7.3.160.0130.00316.55
7.3.130.0060.01316.23
7.3.120.0020.01415.66
7.3.110.0070.00915.70
7.3.100.0090.00615.74
7.3.90.0090.00715.59
7.3.80.0100.00315.64
7.3.70.0100.00515.52
7.3.60.0080.00715.44
7.3.50.0090.01115.53
7.3.40.0090.00915.37
7.3.30.0100.00515.52
7.3.20.0060.00816.54
7.3.10.0050.00816.48
7.3.00.0110.00316.46
7.2.330.0040.01316.48
7.2.320.0080.01216.57
7.2.310.0070.01116.79
7.2.300.0030.01516.70
7.2.290.0090.00916.63
7.2.260.0070.01316.55
7.2.250.0090.01115.84
7.2.240.0100.00615.59
7.2.230.0030.01315.65
7.2.220.0090.00915.91
7.2.210.0110.00515.67
7.2.200.0100.00715.59
7.2.190.0050.01215.67
7.2.180.0070.00815.58
7.2.170.0080.00715.77
7.2.160.0060.00616.61
7.2.150.0040.01418.36
7.2.140.0030.01418.51
7.2.130.0070.01018.36
7.2.120.0000.01518.55
7.2.110.0060.00618.40
7.2.100.0090.00618.45
7.2.90.0100.00718.30
7.2.80.0060.00618.43
7.2.70.0030.01018.37
7.2.60.0030.01018.35
7.2.50.0060.01018.38
7.2.40.0140.00318.49
7.2.30.0130.00318.55
7.2.20.0070.01018.53
7.2.10.0060.00618.54
7.2.00.0140.00318.30
7.1.330.0090.00613.56
7.1.320.0080.00513.61
7.1.310.0060.01113.96
7.1.300.0150.00013.74
7.1.290.0000.01213.88
7.1.280.0040.00913.86
7.1.270.0000.01613.78
7.1.260.0100.00513.98

preferences:
58.55 ms | 401 KiB | 5 Q