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; } }
Output for git.master, git.master_jit

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
43.42 ms | 408 KiB | 5 Q