3v4l.org

run code in 300+ PHP versions simultaneously
<?php $flagList = [ 'DROP_NEW_LINE' => SplFileObject::DROP_NEW_LINE, 'READ_AHEAD' => SplFileObject::READ_AHEAD, 'SKIP_EMPTY' => SplFileObject::SKIP_EMPTY, 'READ_AHEAD-DROP_NEW_LINE' => SplFileObject::READ_AHEAD | SplFileObject::DROP_NEW_LINE, 'READ_AHEAD-SKIP_EMPTY' => SplFileObject::READ_AHEAD | SplFileObject::SKIP_EMPTY, 'DROP_NEW_LINE-SKIP_EMPTY' => SplFileObject::DROP_NEW_LINE | SplFileObject::SKIP_EMPTY, 'READ_AHEAD-SKIP_EMPTY-DROP_NEW_LINE' => SplFileObject::READ_AHEAD | SplFileObject::DROP_NEW_LINE | SplFileObject::SKIP_EMPTY, ]; $file = new SplFileObject('/tmp/test.csv', 'w+'); $file->fwrite("1st\n\n2nd\n"); foreach ($flagList as $type => $flag) { $file->setFlags(SplFileObject::READ_CSV | $flag); if ($file->fgetcsv() === null) { echo $type . ' flag makes fgetcsv return NULL' . PHP_EOL; } }

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.1.70.0040.00417.47
8.1.60.0030.00617.67
8.1.50.0050.00617.45
8.1.40.0000.00817.53
8.1.30.0040.00417.61
8.1.20.0000.00717.64
8.1.10.0000.00817.51
8.1.00.0000.00817.46
8.0.200.0000.00617.02
8.0.190.0050.00316.95
8.0.180.0050.00616.84
8.0.170.0060.00316.91
8.0.160.0060.00316.88
8.0.150.0040.00416.83
8.0.140.0030.00616.89
8.0.130.0000.00613.32
8.0.120.0060.00413.27
8.0.110.0120.00013.32
8.0.100.0110.00013.34
8.0.90.0140.00013.32
8.0.80.0110.00413.33
8.0.70.0060.00813.23
8.0.60.0050.00513.18
8.0.50.0080.00313.29
8.0.30.0080.00413.34
8.0.20.0050.00513.30
8.0.10.0080.00313.39
8.0.00.0060.00513.49
7.4.300.0030.00316.60
7.4.290.0010.00616.49
7.4.280.0000.00716.53
7.4.270.0070.00316.50
7.4.260.0030.00313.32
7.4.250.0080.00413.27
7.4.240.0160.00613.29
7.4.230.0150.00013.31
7.4.220.0060.00613.16
7.4.210.0070.00213.25
7.4.200.0060.00613.35
7.4.190.0090.00413.34
7.4.180.0070.00713.33
7.4.160.0140.00013.39
7.4.150.0090.00513.28
7.4.140.0090.00613.33
7.4.130.0160.00013.27
7.4.120.0100.00213.16
7.4.110.0110.00413.16
7.4.100.0090.00513.25
7.4.90.0100.00213.13
7.4.80.0140.00013.13
7.4.70.0130.00013.18
7.4.60.0100.00313.30
7.4.50.0070.00813.18
7.4.40.0110.00313.11
7.4.30.0070.00313.15
7.4.20.0110.00013.13
7.4.10.0060.00313.24
7.4.00.0040.00413.16
7.3.330.0070.00016.26
7.3.320.0000.00613.04
7.3.310.0070.00413.19
7.3.300.0110.00012.94
7.3.290.0080.00313.04
7.3.280.0000.00912.96
7.3.270.0060.00613.05
7.3.260.0000.01013.07
7.3.250.0090.00313.05
7.3.240.0090.00012.92
7.3.230.0070.00413.06
7.3.220.0080.00013.07
7.3.210.0100.00012.93
7.3.200.0030.00512.96
7.3.190.0090.00012.96
7.3.180.0060.00313.13
7.3.170.0000.00913.13
7.3.160.0090.00013.04
7.3.150.0000.00812.80
7.3.140.0090.00012.96
7.3.130.0030.00513.05
7.3.120.0030.00612.92
7.3.110.0090.00012.90
7.3.100.0040.00412.89
7.3.90.0090.00013.31
7.3.80.0090.00013.12
7.3.70.0080.00013.00
7.3.60.0000.00813.12
7.3.50.0040.00413.26
7.3.40.0030.00613.28
7.3.30.0060.00313.23
7.3.20.0080.00314.93
7.3.10.0060.00314.87
7.3.00.0090.00014.92

preferences:
11.85 ms | 406 KiB | 5 Q