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); ini_set('auto_detect_line_endings', true); $rows = []; while (!$file->eof()) { $row = $file->fgetcsv($delimiter, '"', '\\'); 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.0120.00618.68
8.3.50.0100.00718.02
8.3.40.0090.00618.96
8.3.30.0120.00319.02
8.3.20.0090.00021.02
8.3.10.0040.00420.25
8.3.00.0040.00420.67
8.2.180.0140.00416.88
8.2.170.0080.00822.96
8.2.160.0070.00722.03
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0050.00326.16
8.2.120.0040.00426.16
8.2.110.0000.00920.52
8.2.100.0120.00019.39
8.2.90.0030.00517.75
8.2.80.0040.00418.77
8.2.70.0000.00918.05
8.2.60.0040.00418.03
8.2.50.0040.00418.10
8.2.40.0040.00419.30
8.2.30.0050.00319.39
8.2.20.0000.00818.23
8.2.10.0000.00819.50
8.2.00.0050.00219.42
8.1.280.0120.00625.92
8.1.270.0060.00320.61
8.1.260.0030.00526.35
8.1.250.0050.00328.09
8.1.240.0090.00023.74
8.1.230.0060.00620.85
8.1.220.0060.00317.74
8.1.210.0050.00318.77
8.1.200.0000.01217.35
8.1.190.0090.00017.25
8.1.180.0050.00318.88
8.1.170.0040.00418.62
8.1.160.0030.00619.11
8.1.150.0000.00718.94
8.1.140.0040.00422.18
8.1.130.0000.00720.11
8.1.120.0050.00217.51
8.1.110.0040.00417.50
8.1.100.0000.00717.39
8.1.90.0080.00017.54
8.1.80.0030.00517.43
8.1.70.0000.00717.43
8.1.60.0030.00617.63
8.1.50.0100.00017.54
8.1.40.0080.00017.45
8.1.30.0090.00017.57
8.1.20.0040.00417.59
8.1.10.0030.00617.60
8.1.00.0050.00317.63
8.0.300.0070.00018.77
8.0.290.0060.00316.88
8.0.280.0000.00718.51
8.0.270.0040.00417.31
8.0.260.0030.00320.18
8.0.250.0070.00017.03
8.0.240.0000.00716.98
8.0.230.0070.00017.01
8.0.220.0060.00316.96
8.0.210.0030.00316.95
8.0.200.0030.00316.96
8.0.190.0000.00817.01
8.0.180.0050.00317.00
8.0.170.0060.00316.85
8.0.160.0000.00816.84
8.0.150.0060.00316.96
8.0.140.0040.00416.86
8.0.130.0030.00313.33
8.0.120.0040.00416.79
8.0.110.0040.00416.99
8.0.100.0030.00617.01
8.0.90.0060.00316.84
8.0.80.0070.00716.95
8.0.70.0040.00416.77
8.0.60.0050.00216.88
8.0.50.0000.00716.75
8.0.30.0110.00716.89
8.0.20.0120.00916.94
8.0.10.0030.00516.96
8.0.00.0120.00616.81
7.4.330.0000.00515.55
7.4.320.0030.00316.70
7.4.300.0060.00016.64
7.4.290.0000.00816.55
7.4.280.0030.00516.56
7.4.270.0000.00716.60
7.4.260.0030.00313.49
7.4.250.0000.00716.66
7.4.240.0040.00416.58
7.4.230.0050.00216.74
7.4.220.0040.00416.53
7.4.210.0090.00916.69
7.4.200.0040.00416.47
7.4.130.0120.00616.54
7.4.120.0150.00916.43
7.4.110.0090.00916.41
7.4.100.0040.01816.70
7.4.90.0120.00616.44
7.4.80.0140.00319.39
7.4.70.0170.00016.56
7.4.60.0150.00416.61
7.4.50.0030.01216.62
7.4.40.0060.01716.53
7.4.00.0040.01314.76
7.3.330.0070.00316.25
7.3.320.0060.00013.34
7.3.310.0030.00316.36
7.3.300.0030.00316.33
7.3.290.0000.00716.29
7.3.280.0110.00416.43
7.3.260.0120.00616.56
7.3.240.0080.00816.51
7.3.230.0190.00016.50
7.3.210.0070.01016.69
7.3.200.0130.00316.43
7.3.190.0140.00416.28
7.3.180.0090.01316.57
7.3.170.0110.00716.34
7.3.160.0110.00816.27
7.3.120.0070.01015.06
7.3.110.0080.00814.69
7.3.100.0140.00914.48
7.3.90.0070.01014.99
7.3.80.0090.00915.18
7.3.70.0040.01614.86
7.3.60.0050.00814.72
7.3.50.0060.01114.85
7.3.40.0040.01114.78
7.3.30.0090.01114.82
7.3.20.0140.00614.86
7.3.10.0060.01314.80
7.3.00.0140.00714.96
7.2.330.0120.00616.75
7.2.320.0120.00916.64
7.2.310.0060.01116.82
7.2.300.0110.01116.62
7.2.290.0070.01316.58
7.2.250.0080.00915.20
7.2.240.0030.01315.18
7.2.230.0100.01015.07
7.2.220.0080.00815.13
7.2.210.0040.01215.12
7.2.200.0040.01115.18
7.2.190.0030.01215.24
7.2.180.0110.00315.13
7.2.170.0110.00714.99
7.1.330.0030.01113.88
7.1.320.0040.00914.12
7.1.310.0070.00714.21
7.1.300.0040.01113.84
7.1.290.0000.01313.88
7.1.280.0140.00313.83
7.1.270.0060.01213.99
7.1.260.0050.01113.83

preferences:
65.19 ms | 401 KiB | 5 Q