PackageTrack
Sign in Get early access

league/csv

CSV data manipulation made easy in PHP

9.28.0 193M downloads/mo #200 most downloaded on composer thephpleague/csv

What this package is like to depend on

Last release 7 months ago

27 Dec 2025

Ships fairly regularly

a new release about every 4 weeks

Nearly every release is documented

notes for 83 of 83 stable releases

Nothing withdrawn

no release was ever pulled

13 years old

83 releases · first in 2013

5 releases in the last 12 months

see the full history below

Release timeline

83 releases · Dec 2013 to Dec 2025
2014 2016 2018 2020 2022 2024 2026
Release Pre-release

Releases

latest 60 of 83
  1. 9.28.0 27 Dec 2025
    Release notes

    Added

    • EnumFormatter to format Enum for CSV serialization

    Deprecated

    • None

    Fixed

    • None

    Remove

    • None

    This is the last version supporting PHP8.1

    Open source →
    Release notes

    Added

    • EnumFormatter to format Enum for CSV serialization

    Deprecated

    • None

    Fixed

    • None

    Remove

    • None
    Open source →
    Release notes

    version 9.28.0 Latest

    Latest

    Compare

    Choose a tag to compare

    Open source →
  2. 9.27.1 25 Oct 2025
    Release notes

    Added

    • None

    Deprecated

    • None

    Fixed

    • AbstractCsv::download improved implementation see #569

    Remove

    • None
    Open source →
    Release notes

    Added

    • None

    Deprecated

    • None

    Fixed

    • AbstractCsv::download improved implementation see #569

    Remove

    • None
    Open source →
    Release notes

    version 9.27.1

    Compare

    Choose a tag to compare

    Open source →
  3. 9.27.0 16 Oct 2025
    Release notes

    Added

    • AbstractCsv::from and AbstractCsv::fromString to simplify instantiating Reader and Writer instance.
    • Stream::from and Stream::fromString to simplify internal instantiation of Stream instances.

    Deprecated

    • AbstractCsv::createFromString use AbstractCsv::fromString instead
    • AbstractCsv::createFromStream use AbstractCsv::from instead
    • AbstractCsv::createFromFileObject use AbstractCsv::from instead
    • Stream::createFromResource use Stream::from instead
    • Stream::createFromString use Stream::fromString instead

    Fixed

    • `None

    Remove

    • None
    Open source →
    Release notes

    Added

    • AbstractCsv::from and AbstractCsv::fromString to simplify instantiating Reader and Writer instance.
    • Stream::from and Stream::fromString to simplify internal instantiation of Stream instances.

    Deprecated

    • AbstractCsv::createFromString use AbstractCsv::fromString instead
    • AbstractCsv::createFromStream use AbstractCsv::from instead
    • AbstractCsv::createFromFileObject use AbstractCsv::from instead
    • Stream::createFromResource use Stream::from instead
    • Stream::createFromString use Stream::fromString instead

    Fixed

    • `None

    Remove

    • None
    Open source →
    Release notes

    version 9.27.0

    Compare

    Choose a tag to compare

    Open source →
  4. 9.26.0 01 Oct 2025
    Release notes

    Added

    • JsonFormat::NdJsonHeader and JsonFormat::NdJsonHeaderLess
    • JsonConverter conversion methods accept an optional $header parameter to handle the new JSON formats.
    • Writer::insertAll and converter classes convert methods now accept TabularData and TabularDataProvider implementing classes

    Deprecated

    • None

    Fixed

    • Adding an internal Warning class to fix warnings triggering in the codebase.
    • Fix chunkSize usage when NDJson is generated by the JsonConverter class.
    • NdJson/Jsonlines content-type is fixed to application/x-ndjson.

    Remove

    • None
    Open source →
    Release notes

    Added

    • JsonFormat::NdJsonHeader and JsonFormat::NdJsonHeaderLess
    • JsonConverter conversion methods accept an optional $header parameter to handle the new JSON formats.
    • Writer::insertAll and converter classes convert methods now accept TabularData and TabularDataProvider implementing classes

    Deprecated

    • None

    Fixed

    • Adding an internal Warning class to fix warnings triggering in the codebase.
    • Fix chunkSize usage when NDJson is generated by the JsonConverter class.
    • NdJson/Jsonlines content-type is fixed to application/x-ndjson.

    Remove

    • None
    Open source →
    Release notes

    version 9.26.0

    Compare

    Choose a tag to compare

    Open source →
  5. 9.25.0 11 Sep 2025
    Release notes

    Added

    • JsonFormat Enum to allow exporting to JsonLines with the JsonConverter object.
    • TabularDataProvider interface to allow connecting to the package features without implementing all the methods.

    Deprecated

    • None

    Fixed

    • Fix test around equality, PHPUnit and closures #568
    • Added support for PHP8.5 in github actions
    • Ensure DOMDocument::createTextNode() receives a string #567 by serpentblade

    Remove

    • None
    Open source →
    Release notes

    Added

    • JsonFormat Enum to allow exporting to JsonLines with the JsonConverter object.
    • TabularDataProvider interface to allow connecting to the package features without implementing all the methods.

    Deprecated

    • None

    Fixed

    • Fix test around equality, PHPUnit and closures #568
    • Added support for PHP8.5 in GitHub actions
    • Ensure DOMDocument::createTextNode() [] receives a string #567 by serpentblade

    Remove

    • None
    Open source →
    Release notes

    version 9.25.0

    Compare

    Choose a tag to compare

    Open source →
  6. 9.24.1 25 Jun 2025
    Release notes

    Added

    • None

    Deprecated

    • None

    Fixed

    • Fix possible memory leaks with the Writer class #563 - thanks to pope-12

    Remove

    • None
    Open source →
    Release notes

    Added

    • None

    Deprecated

    • None

    Fixed

    • Fix possible memory leaks with the Writer class #563 - thanks to pope-12

    Remove

    • None
    Open source →
    Release notes

    version 9.24.1

    Compare

    Choose a tag to compare

    Open source →
  7. 9.24.0 24 Jun 2025
    Release notes

    Added

    • TabularData::last and TabularData::lastAsObject

    Deprecated

    • None

    Fixed

    • Improved implementation for AbstractCsv::download method

    Remove

    • None
    Open source →
    Release notes

    Added

    • TabularData::last and TabularData::lastAsObject

    Deprecated

    • None

    Fixed

    • Improved implementation for AbstractCsv::download method

    Remove

    • None
    Open source →
    Release notes

    version 9.24.0

    Compare

    Choose a tag to compare

    Open source →
  8. 9.23.0 28 Mar 2025
    Release notes

    Added

    • TypeCastingInfo to improve error message when type casting fails during denormalization #561

    Deprecated

    • fetchColumnByOffset and fetchColumnByName use fetchColumn instead.

    Fixed

    • Test suite around header testing using Xdebug functions #559

    Remove

    • None
    Open source →
    Release notes

    Added

    • TypeCastingInfo to improve the error message when type casting fails during denormalization #561

    Deprecated

    • fetchColumnByOffset and fetchColumnByName use fetchColumn instead.

    Fixed

    • Test suite around header testing using Xdebug functions #559

    Remove

    • None
    Open source →
    Release notes

    version 9.23.0

    Compare

    Choose a tag to compare

    Open source →
  9. 9.22.0 28 Feb 2025
    Release notes

    Added

    • Writer::necessaryEnclosure
    • TabularDataReader::selectAllExcept
    • Statement::selectAllExcept
    • ResultSet::from and ResultSet::tryFrom
    • RdbmsResult class to ease importing RDBMS result into the package classes
    • TabularData interface
    • Buffer class
    • XMLConverter::supportsHeader
    • XMLConverter::when
    • HTMLConverter::when
    • JsonConverter::when
    • CharsetConverter::appendOnReadTo, CharsetConverter::appendOnWriteTo, CharsetConverter::prependOnReadTo, CharsetConverter::prependOnWriteTo

    Deprecated

    • Writer::relaxEnclosure use Writer::necessaryEnclosure
    • ResultSet::createFromTabularDataReader use ResultSet::from
    • ResultSet::createFromRecords use ResultSet::from
    • ResultSet::__construct is marked as being internal and deprecated before being made private use ResultSet::from
    • XMLConverter::convert use XMLConverter::import instead
    • XMLConverter::create use XMLConverter::__construct instead
    • HTMLConverter::create use HTMLConverter::__construct instead
    • Statement::create use Statement::__construct instead
    • FragmentFinder::create use FragmentFinder::__construct instead
    • CharsetConverter::appendTo, CharsetConverter::prependTo use the more strict methods added on the instance

    Fixed

    • Comparison::CONTAINS must check the value is a string before calling str_compare #548 by cage-is
    • Fix testing to improve Debian integration #549 by David Prévot and tenzap
    • Bom::tryFromSequence and Bom::fromSequence supports the Reader and Writer classes.
    • XMLConverter::$formatter should not be public.
    • XMLConverter internal rewritten to take advantage of PHP8.4 new dom classes
    • HTMLConverter internal rewritten to take advantage of PHP8.4 new dom classes
    • XMLConverter::fieldElement now has a nullable field element to allow using headers names as cell names.

    Removed

    • None
    Open source →
    Release notes

    Added

    • Writer::necessaryEnclosure
    • TabularDataReader::selectAllExcept
    • Statement::selectAllExcept
    • ResultSet::from and ResultSet::tryFrom
    • RdbmsResult class to ease importing RDBMS result into the package classes
    • TabularData interface
    • Buffer class
    • XMLConverter::supportsHeader
    • XMLConverter::when
    • HTMLConverter::when
    • JsonConverter::when
    • CharsetConverter::appendOnReadTo, CharsetConverter::appendOnWriteTo, CharsetConverter::prependOnReadTo, CharsetConverter::prependOnWriteTo

    Deprecated

    • Writer::relaxEnclosure use Writer::necessaryEnclosure
    • ResultSet::createFromTabularDataReader use ResultSet::from
    • ResultSet::createFromRecords use ResultSet::from
    • ResultSet::__construct is marked as being internal and deprecated before being made private use ResultSet::from
    • XMLConverter::convert use XMLConverter::import instead
    • XMLConverter::create use XMLConverter::__construct instead
    • HTMLConverter::create use HTMLConverter::__construct instead
    • Statement::create use Statement::__construct instead
    • FragmentFinder::create use FragmentFinder::__construct instead
    • CharsetConverter::appendTo, CharsetConverter::prependTo use the more strict methods added on the instance

    Fixed

    • Comparison::CONTAINS must check the value is a string before calling str_compare #548 by cage-is
    • Fix testing to improve Debian integration #549 by David Prévot and tenzap
    • Bom::tryFromSequence and Bom::fromSequence supports the Reader and Writer classes.
    • XMLConverter::$formatter should not be public.
    • XMLConverter internal rewritten to take advantage of PHP8.4 new dom classes
    • HTMLConverter internal rewritten to take advantage of PHP8.4 new dom classes
    • XMLConverter::fieldElement now has a nullable field element to allow using headers names as cell names.

    Removed

    • None
    Open source →
    Release notes

    version 9.22.0

    Compare

    Choose a tag to compare

    Open source →
  10. 9.21.0 08 Jan 2025
    Release notes

    Added

    • TabularDataReader::map method.
    • StreamFilter class
    • CallbackStreamFilter class
    • AbstractCsv::appendStreamFilterOnRead
    • AbstractCsv::appendStreamFilterOnWrite
    • AbstractCsv::prependStreamFilterOnRead
    • AbstractCsv::prependStreamFilterOnWrite
    • Stream::getMode returns the underlying stream mode; internal codebase.

    Deprecated

    • AbstractCsv::addStreamFilter use AbstractCsv::appendStreamFilterOnRead or AbstractCsv::appendStreamFilterOnWrite instead.

    Fixed

    • Improve CharsetConverter and SwapDelimiter internal code.
    • Fix supportStreamFilterOnReadand supportStreamFilterOnWrite to expose the document real stream filter capabilities.

    Removed

    • None
    Open source →
    Release notes

    Added

    • TabularDataReader::map method.
    • StreamFilter class
    • CallbackStreamFilter class
    • AbstractCsv::appendStreamFilterOnRead
    • AbstractCsv::appendStreamFilterOnWrite
    • AbstractCsv::prependStreamFilterOnRead
    • AbstractCsv::prependStreamFilterOnWrite
    • Stream::getMode returns the underlying stream mode; internal codebase.

    Deprecated

    • AbstractCsv::addStreamFilter use AbstractCsv::appendStreamFilterOnRead or AbstractCsv::appendStreamFilterOnWrite instead.

    Fixed

    • Improve CharsetConverter and SwapDelimiter internal code.
    • Fix supportStreamFilterOnReadand supportStreamFilterOnWrite to expose the document real stream filter capabilities.

    Removed

    • None
    Open source →
    Release notes

    version 9.21.0

    Compare

    Choose a tag to compare

    Open source →
  11. 9.20.1 18 Dec 2024
    Release notes

    Added

    • None

    Deprecated

    • None

    Fixed

    • #554 Fix stream filte removal by crocodele
    • Fix Statement callback and closure signature

    Removed

    • None
    Open source →
  12. 9.20.0 13 Dec 2024
    Release notes

    Added

    • XMLConverter::formatter
    • HTMLConverter::formatter
    • Writer::encloseNone
    • Writer::encloseNecessary
    • Writer::noEnclosure

    Deprecated

    • None

    Fixed

    • JsonConverter::formatter now accepts callable before only Closure where accepted.
    • The protected property Writer::$enclose_all is no longer a boolean but an integer

    Removed

    • None
    Open source →
  13. 9.19.0 08 Dec 2024
    Release notes

    Added

    • JsonConverter::withPrettyPrint now accepts an optional $identSize parameter as its unique parameter.
    • Statement::when to enable conditionable query building.
    • Using PHP8.4 Deprecated attribute to signal deprecated public API methods and constants.

    Deprecated

    • JsonConverter::indentSize

    Fixed

    • Adding forgotten support for callable in the Query\Constraint namespace.
    • Fix HttpHeaders::forFileDownload to be inline with RFC2183 and HTTP field name and value best practices.

    Remove

    • None
    Open source →
  14. 9.18.0 18 Oct 2024
    Release notes

    Added

    • League\Csv\JsonConverter::chunkSize
    • League\Csv\AbstractCsv::download

    Deprecated

    • League\Csv\AbstractCsv::output use League\Csv\AbstractCsv::download instead
    • League\Csv\FragmentFinder and derived methods are marked as experimental as their results will be changed in the next major version.

    Fixed

    • League\Csv\JsonConverter::download the filename is now nullable
    • League\Csv\XMLConverter::download the filename is now nullable
    • League\Csv\JsonConverter::save throws a TypeError exception if the $destination type is not supported.

    Remove

    • None
    Open source →
  15. 9.17.0 10 Oct 2024
    Release notes

    Added

    • League\Csv\SwapDelimiter::apppendTo
    • League\Csv\SwapDelimiter::prependTo
    • League\Csv\CharsetConverter::apppendTo
    • League\Csv\CharsetConverter::prependTo
    • League\Csv\XMLConverter::download
    • League\Csv\JsonConverter
    • League\Csv\Constraint\Criteria::andNot
    • League\Csv\Constraint\Criteria::orNot
    • League\Csv\Constraint\Criteria::xorNot
    • League\Csv\Serializer\MapRecord attribute
    • adding the convertEmptyStringToNull options to MapCell and to MapRecord to improve string and null conversion
    • adding the trimFieldValueBeforeCasting options to MapCell and to MapRecord to improve string conversion
    • adding the trimElementValueBeforeCasting option to CasToArray to improve conversion during denormalization
    • adding the headerOffset option to CasToArray to improve conversion during denormalization. The optoon is only used with the CSV shape.

    Deprecated

    • None

    Fixed

    • Cast* methods accept more input type to improve Denormalization usage when Reader::addFormatter is used or when the collection contains data other than string and null.
    • Stream::getSize is added to the internal Stream class
    • Stream::getContents is added to the internal Stream class
    • MapIterator::toIterator is added to the internal class MapIterator class to convert any iterable into an Iterator.
    • Casting a CSV to an array it now will be a collection of array instead of a simple array.
    • Added the internal class HttpHeaders to improve file download throughout the codebase.

    Removed

    • leage\csv-doctrine is no longer a sub-split of the main league/csv package.
    Open source →
  16. 9.16.0 24 May 2024
    Release notes

    Added

    • Bom enum
    • Stream::ftell
    • Statement::orderByAsc
    • Statement::orderByDesc
    • Statement::andWhere
    • Statement::whereNot
    • Statement::orWhere
    • Statement::xorWhere
    • Statement::andWhereColumn
    • Statement::whereNotColumn
    • Statement::orWhereColumn
    • Statement::xorWhereColumn
    • Statement::andWhereOffset
    • Statement::whereNotOffset
    • Statement::orWhereOffset
    • Statement::xorWhereOffset
    • Query feature to allow easier filtering, ordering and querying tabular data

    Deprecated

    • ByteSequence Interface use the Bom enum instead
    • Info::fetchBOMSequence use Bom::tryFromSequence instead
    • League\Csv\Doctrine use the new League\Csv\Constraint feature instead
    • League\Csv\Statement::create arguments; The method should be used without any argument at all. All arguments will be removed in the next major version.

    Fixed

    • Reader and ResultSet docblocks
    • internal code uses Bom enum instead of Info::fetchBOMSequence
    • the AbstractCsv BOM related properties are moved to being Bom instances instead of nullable string.
    • setOutpuBOM will only accept valid BOM sequences all other values except the empty string will throw a ValueError exception;
    • The package no longer requires the ext-mbstring extension to work. But you should have it install in your system in order to use the mbstring related stream filters.
    • Issue #524 fix issue with ResultSet::chunkBy not working as documented.

    Removed

    • None
    Open source →
  17. 9.15.0 20 Feb 2024
    Release notes

    Added

    • Statement::select
    • TabularDataReader::getRecordsAsObject
    • TabularDataReader::chunkBy
    • TabularDataReader::mapHeader

    Deprecated

    • TabularDataReader::getObjects use TabularDataReader::getRecordsAsObject instead

    Fixed

    • Reader::select and ResultSet::select now internally use Statement::select
    • Statement should not throw when LimitIterator is used in combinaison with ArrayIterator.
    • Statement internal codebase improvement.
    • Using the $header argument on Statement::process is no longer deprecated. E_USER_DEPRECATED is no longer triggered.
    • BOM stripping no longer depends on the mbstring extension
    • TabularDataReader::fetchColumn is no longer deprecated

    Removed

    • None
    Open source →
  18. 9.14.0 29 Dec 2023
    Release notes

    Added

    • League\Csv\TabularDataReader::nthAsObject equivalent to nth but returns an object or null
    • League\Csv\TabularDataReader::firstAsObject equivalent to first but returns an object or null
    • League\Csv\Serializer\Denormalizer::types list all the registered types

    Deprecated

    • None

    Fixed

    • None

    Removed

    • None
    Open source →
  19. 9.13.0 16 Dec 2023
    Release notes

    Added

    • League\Csv\SwapDelimiter stream filter to allow working with multibyte CSV delimiter
    • League\Csv\Serializer\AfterMapping to work around the limitation of not using the class constructor during denormalization.
    • League\Csv\Serializer\Denormalizer to allow registering type alias to improve callback usage.
    • League\Csv\Serializer\MapCell has a new property ignore to allow ignoring a property or a method during denormalization.

    Deprecated

    • None

    Fixed

    • None

    Removed

    • None
    Open source →
  20. 9.12.0 01 Dec 2023
    Release notes

    Added

    • TabulatDataReader::value
    • TabulatDataReader::select
    • TabulatDataReader::getObjects
    • TabulatDataReader::matching
    • TabulatDataReader::matchingFirst
    • TabulatDataReader::matchingFirstOrFail
    • ResultSet::fromRecords
    • Stream::setMaxLineLen
    • Stream::getMaxLineLen
    • League\Csv\Serializer\Denormalizer to allow denormalizing records into objects #508
    • League\Csv\FragmentFinder to implement RFC7111

    Deprecated

    • Using the $header argument on Statement::process is deprecated and will be removed in the next version. Use TabularDataReader::getRecords on the returned value instead. It's usage will trigger a E_USER_DEPRECATED call.

    Fixed

    • The optional $header argument for TabularDataReader::getRecords becomes a full mapper between the records column offset and the column names #498
    • ResultSet constructor now allows the records to be an array.
    • The internal Stream object will throw a RuntimeException if the rewind action fails
    • if calls to fseek fails (returns -1 ) a RuntimeException will be thrown.
    • Stream can iterate and return the full line respecting SplFielObject flags. Previously it only returned the CSV records.
    • MapIterator::fromIterable to instantiate a MapIterator object from any iterable structure.

    Removed

    • None
    Open source →
  21. 9.11.0 23 Sep 2023
    Release notes

    Added

    • EscapeFormula::unescapeRecord does the opposite of EscapeFormula::escapeRecord
    • TabularReader::each (implemented on the Reader and the ResultSet object)
    • TabularReader::exists (implemented on the Reader and the ResultSet object)
    • TabularReader::reduce (implemented on the Reader and the ResultSet object)
    • TabularReader::filter (implemented on the Reader and the ResultSet object)
    • TabularReader::slice (implemented on the Reader and the ResultSet object)
    • TabularReader::sorted (implemented on the Reader and the ResultSet object)
    • Reader::addFormatter (implemented on the Reader and the ResultSet object)

    Deprecated

    • EscapeFormula::__invoke use EscapeFormula::escapeRecord instead

    Fixed

    • None

    Removed

    • None
    Open source →
  22. 9.10.0 04 Aug 2023
    Release notes

    Added

    • Writer::forceEnclosure and Writer::relaxEnclosure to control the presence of enclosure in the generated CSV
    • Writer::getEndOfLine and Writer::setEndOfLine

    Deprecated

    • EncloseField stream filter in favor of the new Writer::forceEnclosure method.
    • Writer::getNewline and Writer::setNewline in favor of Writer::getEndOfLine and Writer::setEndOfLine

    Fixed

    • Stream::fwrite to allow writing to a file in a normalized way. Internal use.
    • Documentation Fixed removing unreleased documented feature by @nclavaud

    Removed

    • None
    Open source →
  23. 9.9.0 11 Mar 2023
    Release notes

    Added

    • TabularDataWriter interface to represent how to write to a tabular data document.
    • TabularDataReader::first to replace TabularDataReader::fetchOne
    • TabularDataReader::nth to replace TabularDataReader::fetchOne
    • CharsetConverter::addBOMSkippingTo to improve BOM skipping see bug #483

    Deprecated

    • TabularDataReader::fetchOne

    Fixed

    • Stream::createFromResource

    • Stream::__construct is made private. The class is already marked as internal so BC break does not apply on it.

    • Using PHP8 feature to rewrite internal codebase

    • Replaced simple comparisons with strict comparison operator where types are obvious in internal codebase by @astepin

    • Marked class constants explicitly as public by @astepin

    • Minimal support version PHP8.1.2

    • Fix Docblock and method signature using PHP8 feature (Union Type)

    • Fix Internal codebase around seek usage and `#75917 requires PHP8.1.2

    • Remove internal usage of deprecated methods

    Removed

    • Stream::fwrite The class is already marked as internal so BC break does not apply on it.
    • Stream::fgets The class is already marked as internal so BC break does not apply on it.
    • Drop support for PHP7 and PHP8.0
    • Polyfill to enable using fputcsv $eol argument
    Open source →
  24. 9.8.0 04 Jan 2022
    Release notes

    Added

    • Added PHP7.4 typed properties where applicable
    • TabularDataReader::fetchColumnByName to replace TabularDataReader::fetchColumn
    • TabularDataReader::fetchColumnByOffset to replace TabularDataReader::fetchColumn

    Deprecated

    • TabularDataReader::fetchColumn use TabularDataReader::fetchColumnByOffset or TabularDataReader::fetchColumnByName instead

    Fixed

    • AbstractCsv constructor is marked final via docblock.
      The method should never be extended or changed in child classes to avoid unexpected behaviour

    Removed

    • PHP7.3 support
    • Remove internal EmptyEscapeParser Polyfill used in Reader class
    • Remove PHP7.4 polyfill features in Writer class
    Open source →
  25. 9.7.4 30 Nov 2021
    Release notes

    Added

    • None

    Deprecated

    • None

    Fixed

    Removed

    • None
    Open source →
  26. 9.7.3 21 Nov 2021
    Release notes

    Added

    • None

    Deprecated

    • None

    Fixed

    • Update PHPStan requirement for development
    • Improve Documentation generation thanks to pdelre
    • PHP8.1 compliance: using ReturnTypeWillChange to avoid emitting a unnecessary deprecation notice. thanks to cedric-anne

    Removed

    • None
    Open source →
  27. 9.7.2 05 Oct 2021
    Release notes

    Added

    • None

    Deprecated

    • None

    Fixed

    • Update dependencies requirement for development
    • PHP8.1 compliance: replace FILTER_SANITIZE_STRING by FILTER_UNSAFE_RAW
    • PHP8.1 compliance: remove duplicated public properties declaration
    • PHP8.1 compliance: add support for fputcsv $eol argument

    Removed

    • None
    Open source →
  28. 9.7.1 17 Apr 2021
    Release notes

    Added

    • None

    Deprecated

    • None

    Fixed

    Removed

    • None
    Open source →
  29. 9.7.0 26 Mar 2021
    Release notes

    Added

    • League\Csv\SyntaxError::duplicateColumnNames to expose column name duplicates during header usage
    • League\Csv\UnableToProcessCsv as the new Exception Marker Interface
    • League\Csv\UnavailableStream as the new Exception
    • League\Csv\Info::getDelimiterStats to replace the namespace function delimiter_detect
    • League\Csv\Info::fetchBOMSequence to replace the namespace function bom_match
    • League\Csv\AbstractCsv::toString to replace League\Csv\AbstractCsv::getContent and League\Csv\AbstractCsv::__toString
    • League\Csv\XMLConverter::create to replace League\Csv\XMLConverter::__construct
    • League\Csv\HTMLConverter::create to replace League\Csv\HTMLConverter::__construct
    • League\Csv\AbstractCsv::supportsStreamFilterOnRead and League\Csv\AbstractCsv::supportsStreamFilterOnWrite to replace League\Csv\AbstractCsv::supportsStreamFilter and League\Csv\AbstractCsv::getStreamFilterMode

    Deprecated

    • League\Csv\delimiter_detect use League\Csv\Info::getDelimiterStats
    • League\Csv\bom_match use League\Csv\Info::fetchBOMSequence
    • League\Csv\AbstractCsv::getContent use League\Csv\AbstractCsv::toString
    • League\Csv\AbstractCsv::getStreamFilterMode use League\Csv\AbstractCsv::supportsStreamFilterOnRead or League\Csv\AbstractCsv::supportsStreamFilterOnWrite
    • League\Csv\AbstractCsv::supportsStreamFilter use League\Csv\AbstractCsv::supportsStreamFilterOnRead or League\Csv\AbstractCsv::supportsStreamFilterOnWrite
    • Calling exceptions constructor, use named constructors instead.
    • League\Csv\XMLConverter::__construct use League\Csv\XMLConverter::create
    • League\Csv\HTMLConverter::__construct use League\Csv\HTMLConverter::create

    Fixed

    • Move tests into the src directory
    • Fixed encoder method resolver implementation
    • all classes marked as @internal are now final
    • League\Csv\AbstractCsv::STREAM_FILTER_MODE constant replaces League\Csv\AbstractCsv::$stream_filter_mode

    Removed

    • PHP7.2 support
    • League\Csv\AbstractCsv::$stream_filter_mode
    Open source →
  30. 9.6.2 10 Dec 2020
    Release notes

    Added

    • Using Github actions as development tools.

    Deprecated

    • None

    Fixed

    Removed

    • Removing Travis and Scrutinizr as development tools
    Open source →
  31. 9.6.1 05 Sep 2020
    Release notes

    Added

    • None

    Deprecated

    • None

    Fixed

    • BOM sequence processing fix #394

    Removed

    • None
    Open source →
  32. 9.6.0 17 Mar 2020
    Release notes

    Added

    • More return types and type parameters as supported in PHP7.2+
    • League\Csv\Statement::create named constructor to ease constraint builder instantiation
    • League\Csv\Statement can now also process League\Csv\ResultSet instances.
    • League\Csv\TabularDataReader interface to represent how to read tabular data
    • League\Csv\ResultSet::getRecords has an optional $header second argument to make the method works like League\Csv\Reader::getRecords
    • League\Csv\ResultSet::createFromTabularDataReader create a new instance from League\Csv\TabularDataReader implementing class.

    Deprecated

    • Nothing

    Fixed

    • League\Csv\Reader no longer uses __call to implement fetchOne, fetchPairs and fetchColumn methods.

    Removed

    • Internal polyfill for is_iterable
    • Internal polyfill for is_nullable_int
    • Support for PHP7.0 and PHP7.1
    Open source →
  33. 9.5.0 15 Dec 2019
    Release notes

    Added

    • Improve package exception throwing by adding new exceptions classes that extends the League\Csv\Exception exception marker class #360, #361 feature proposed and developed by Darren Miller
      • League\Csv\UnavailableFeature
      • League\Csv\InvalidArgument
      • League\Csv\SyntaxError

    Deprecated

    • Nothing

    Fixed

    • bug fix bom_match function see issue #363 resolved based on PR from Jerry Martinez
    • bug fix delemiter_detect function see issue #366

    Removed

    • Nothing
    Open source →
  34. 9.4.1 17 Oct 2019
    Release notes

    Added

    • Nothing

    Deprecated

    • Nothing

    Fixed

    • bug fix the escape mechanism polyfill #358 fix provided by on2

    Removed

    • Nothing
    Open source →
  35. 9.4.0 02 Oct 2019
    Release notes

    Added

    • Adding support for controlling empty record presence in Reader::getRecords return value.

      • Reader::includeEmptyRecords
      • Reader::skipEmptyRecords
      • Reader::isEmptyRecordsIncluded
    • Adding support for controlling Input BOM usage in the library:

      • AbstractCsv::skipInputBOM
      • AbstractCsv::includeInputBOM
      • AbstractCsv::isInputBOMIncluded

    Deprecated

    • Nothing

    Fixed

    • EmptyEscapeParser::parse no longer auto skip empty records

    Removed

    • Nothing
    Open source →
  36. 9.3.0 30 Jul 2019
    Release notes

    Added

    • XMLConverter::import see #348 thanks @kusabi
    • Support for thead, tfoot and tbody in HTMLConverter::convert via the addition of protected methods HTMLConverter::addHTMLAttributes and HTMLConverter::appendHeaderSection #348 thanks @kusabi

    Deprecated

    • Nothing

    Fixed

    • Internal improvement in Reader dockblock thanks @ghobaty.
    • Improve strict comparison when using preg_match.
    • Improve CSV control in Stream.

    Removed

    • Nothing
    Open source →
  37. 9.2.1 07 Jun 2019
    Release notes

    Added

    • Nothing

    Deprecated

    • Nothing

    Fixed

    • AbstractCSV::chunk see #325 remove CSV flags from the Stream class to avoid infinite loop.
    • Internal improve HTMLConverter.

    Removed

    • Nothing
    Open source →
  38. 9.2.0 08 Mar 2019
    Release notes

    Added

    • Supports for PHP7.4 empty string for the escape character
    • Supports for empty string for the escape character with a polyfill for PHP7.4- versions.
    • AbstractCSV::getPathname see #321 thanks @tomkyle

    Deprecated

    • League\Csv\RFC4180Field use AbstractCSV::setEscape method with an empty string instead.

    Fixed

    • AbstractCSV::__construct correctly initializes properties

    • AbstractCSV::createFromString named constructor default argument is now an empty string

    • AbstractCSV::setEscape now accepts an empty string like fputcsv and fgetcsv

    • Writer::insertOne fixes throwing exception when record can not be inserted

    • XMLConverter convert to string the record value to avoid PHP warning on null value

    • Internal Stream::createFromString named constructor default argument is now an empty string

    • Internal Stream::fwrite improved

    • Internal Stream::__destruct no longer emit warning on invalid stream filter removal.

    • Internal Stream::seek returns 0 if the seeked position 0 is valid see #321 thanks @HaozhouChen

    • Reader:getHeader when the record is an empty line.

    Removed

    • Nothing
    Open source →
  39. 9.1.4 01 May 2018
    Release notes

    Added

    • Nothing

    Deprecated

    • Nothing

    Fixed

    • Writer::setFlushThreshold should accept 1 as an argument #289
    • CharsetConverter::convert should not try to convert numeric value #287

    Removed

    • Nothing
    Open source →
  40. 9.1.3 12 Mar 2018
    Release notes

    Added

    • Nothing

    Deprecated

    • Nothing

    Fixed

    • Writer::insertOne allow empty array to be added to the CSV (allow inserting empty row)
    • Removed all return type from named constructor see #285
    • Added PHPStan for static code analysis

    Removed

    • Nothing
    Open source →
  41. 9.1.2 05 Feb 2018
    Release notes

    Added

    • Nothing

    Deprecated

    • Nothing

    Fixed

    • is_iterable polyfill for PHP7.0
    • Reader::getHeader no longer throws exception because of a bug in PHP7.2+ issue #279

    Removed

    • Nothing
    Open source →
  42. 9.1.1 28 Nov 2017
    Release notes

    Added

    • Nothing

    Deprecated

    • Nothing

    Fixed

    • issue with error_get_last usage when using a modified PHP error handler see #254 - fixed by @csiszarattila

    • Removed seekable word from Stream exception messages.

    Removed

    • Nothing
    Open source →
  43. 9.1.0 20 Oct 2017
    Release notes

    Added

    • Support for non-seekable stream. When seekable feature are required an exceptions will be thrown.
    • League\Csv\EncloseField to force enclosure insertion on every field. #269
    • League\Csv\EscapeFormula a League CSV formatter to prevent CSV Formula Injection in Spreadsheet programs.
    • League\Csv\RFC4180Field::addTo accept an option $replace_whitespace argument to improve RFC4180 compliance.
    • League\Csv\Abstract::getContent to replace League\Csv\Abstract::__toString. The __toString method may trigger a Fatal Error with non-seekable stream, instead you are recommended to used the new getContent method which will trigger an exception instead.

    Deprecated

    • League\Csv\Abstract::__toString use League\Csv\Abstract::getContent instead. the __toString triggers a Fatal Error when used on a non-seekable CSV document. use the getContent method instead which will trigger an exception instead.

    Fixed

    • Bug fixes headers from AbstractCsv::output according to RFC6266 #250
    • Make sure the internal source still exists before closing it #251
    • Make sure the Reader::createFromPath default open mode is r see #258 and #266

    Removed

    • Nothing
    Open source →
  44. 9.0.1 21 Aug 2017
    Release notes

    Added

    • Nothing

    Deprecated

    • Nothing

    Fixed

    • CSV controls not applied when calling Writer::insertOne

    Removed

    • Nothing
    Open source →
  45. 9.0.0 18 Aug 2017
    Release notes

    Added

    • Improved CSV Records selection
      • League\Csv\Reader::getRecords to access all CSV records
      • League\Csv\Statement provides a constraint builder to select CSV records.
      • League\Csv\ResultSet represents the result set of the selected CSV records.
      • League\Csv\delimiter_detect function to detect CSV delimiter character
    • Improved CSV document header selection.
      • League\Csv\Reader::getHeader
      • League\Csv\Reader::getHeaderOffset
      • League\Csv\Reader::setHeaderOffset
    • Improved CSV Records conversion
      • League\Csv\CharsetConverter converts CSV records charset.
      • League\Csv\XMLConverter converts CSV records into DOMDocument
      • League\Csv\HTMLConverter converts CSV records into HTML table.
    • Improved Exception handling
      • League\Csv\Exception the default exception
      • League\Csv\CannotInsertRecord
    • Improved CSV document output
      • League\Csv\AbstractCsv::chunk method to output the CSV document in chunk
      • League\Csv\bom_match function to detect BOM sequence in a given string
      • League\Csv\ByteSequence interface to decoupled BOM sequence from CSV documents
    • Improved CSV records column count consistency on insertion
      • League\Csv\ColumnConsistency
    • Improved CSV document flush mechanism on insertion
      • League\Csv\Writer::setFlushThreshold
      • League\Csv\Writer::getFlushThreshold
    • Improve RFC4180 compliance
      • League\Csv\RFC4180Field to format field according to RFC4180 rules

    Deprecated

    • Nothing

    Fixed

    • Improved CSV record insertion

      • League\Csv\Writer::insertOne only accepts an array and returns a integer
      • League\Csv\Writer::insertAll only accepts an iterable of array and returns an integer
    • Normalized CSV offset returned value

      • League\Csv\Reader::fetchColumn always returns the CSV document original offset.

    Removed

    • examples directory
    • PHP5 support
    • The following method is removed because The BOM API is simplified:
      • League\Csv\AbstractCsv::stripBOM
    • All conversion methods are removed in favor of the conversion classes:
      • League\Csv\Writer::jsonSerialize
      • League\Csv\AbstractCsv::toHTML
      • League\Csv\AbstractCsv::toXML
      • League\Csv\AbstractCsv::setInputEncoding
      • League\Csv\AbstractCsv::getInputEncoding
    • The following methods are removed because the PHP stream filter API is simplified:
      • League\Csv\AbstractCsv::isActiveStreamFilter
      • League\Csv\AbstractCsv::setStreamFilterMode
      • League\Csv\AbstractCsv::appendStreamFilter
      • League\Csv\AbstractCsv::prependStreamFilter
      • League\Csv\AbstractCsv::removeStreamFilter
      • League\Csv\AbstractCsv::clearStreamFilters
    • The following methods are removed because switching between connections is no longer possible:
      • League\Csv\AbstractCsv::newReader
      • League\Csv\AbstractCsv::newWriter
      • League\Csv\Reader::getNewline
      • League\Csv\Reader::setNewline
    • The Exception mechanism is improved thus the following class is removed:
      • League\Csv\Exception\InvalidRowException;
    • The CSV records filtering methods are removed in favor of the League\Csv\Statement class:
      • League\Csv\AbstractCsv::addFilter,
      • League\Csv\AbstractCsv::addSortBy,
      • League\Csv\AbstractCsv::setOffset,
      • League\Csv\AbstractCsv::setLimit;
    • CSV records selecting API methods is simplified:
      • League\Csv\Reader::each
      • League\Csv\Reader::fetch
      • League\Csv\Reader::fetchAll
      • League\Csv\Reader::fetchAssoc
      • League\Csv\Reader::fetchPairsWithoutDuplicates
    • Formatting and validating CSV records on insertion is simplified, the following methods are removed:
      • League\Csv\Writer::hasFormatter
      • League\Csv\Writer::removeFormatter
      • League\Csv\Writer::clearFormatters
      • League\Csv\Writer::hasValidator
      • League\Csv\Writer::removeValidator
      • League\Csv\Writer::clearValidators
      • League\Csv\Writer::getIterator
    • The following Formatters and Validators classes are removed from the package:
      • League\Csv\Plugin\SkipNullValuesFormatter
      • League\Csv\Plugin\ForbiddenNullValuesValidator
      • League\Csv\Plugin\ColumnConsistencyValidator replace by League\Csv\ColumnConsistency
    • League\Csv\Writer no longers implements the IteratorAggregate interface
    • League\Csv\AbstractCsv::fetchDelimitersOccurrence is removed replace by League\Csv\delimiter_detect function
    Open source →
  46. 8.2.3 06 Feb 2018
    Release notes

    Added

    • None

    Deprecated

    • None

    Fixed

    • Reader::fetchAssoc no longer throws exception because of a bug in PHP7.2+ issue #279

    Removed

    • None
    Open source →
  47. 8.2.2 12 Jul 2017
    Release notes

    Added

    • None

    Deprecated

    • None

    Fixed

    • Writer::insertOne was silently failing when inserting record in a CSV document in non-writing mode.
    • bug fix docblock

    Removed

    • None
    Open source →
  48. 8.2.1 23 Feb 2017
    Release notes

    Added

    • Nothing

    Deprecated

    • Nothing

    Fixed

    • internal Reader::getRow when using a StreamIterator issue #213
    • Removed @deprecated from selected methods issue #208

    Removed

    • Nothing
    Open source →
  49. 8.2.0 25 Jan 2017
    Release notes

    Added

    • AbstractCsv::createFromStream to enable working with resource stream issue #202

    Deprecated

    • League\Csv\AbstractCsv::stripBom
    • League\Csv\Reader::getOffset
    • League\Csv\Reader::getLimit
    • League\Csv\Reader::getSortBy
    • League\Csv\Reader::getFilter
    • League\Csv\Reader::setOffset
    • League\Csv\Reader::setLimit
    • League\Csv\Reader::addSortBy
    • League\Csv\Reader::addFilter
    • League\Csv\Reader::fetch
    • League\Csv\Reader::each
    • League\Csv\Reader::fetchPairsWithoutDuplicates
    • League\Csv\Reader::fetchAssoc
    • League\Csv\Writer::removeFormatter
    • League\Csv\Writer::hasFormatter
    • League\Csv\Writer::clearFormatters
    • League\Csv\Writer::removeValidator
    • League\Csv\Writer::hasValidator
    • League\Csv\Writer::clearValidators
    • League\Csv\Writer::jsonSerialize
    • League\Csv\Writer::toHTML
    • League\Csv\Writer::toXML

    Fixed

    • Nothing

    Removed

    • Nothing
    Open source →
  50. 8.1.2 27 Oct 2016
    Release notes

    Added

    • Nothing

    Deprecated

    • Nothing

    Fixed

    • BOM filtering fix issue #184
    • AbstractCsv::BOM_UTF32_LE value fixed

    Removed

    • Nothing
    Open source →
  51. 8.1.1 05 Sep 2016
    Release notes

    Added

    • Nothing

    Deprecated

    • Nothing

    Fixed

    • getInputBOM method name is now consistent everywhere in the API PR #171
    • preserve fileObject CSV controls commit #8a20c56
    • Change output method header content-type value to text/csv PR #175

    Removed

    • Nothing
    Open source →
  52. 8.1.0 30 May 2016
    Release notes

    Added

    • The package now includes its own autoloader.
    • Ouput::getInputEncoding
    • Ouput::setInputEncoding

    Deprecated

    • Ouput::getEncodingFrom replaced by Ouput::getInputEncoding
    • Ouput::setEncodingFrom replaced by Ouput::setInputEncoding

    Fixed

    • Stream Filters are now url encoded before usage issue #72
    • All internal parameters are now using the snake case format

    Removed

    • Nothing
    Open source →
  53. 8.0.0 11 Dec 2015
    Release notes

    Added

    • Reader::fetchPairs
    • Reader::fetchPairsWithoutDuplicates

    Deprecated

    • Nothing

    Fixed

    • Reader::fetchColumn and Reader::fetchAssoc now return Iterator
    • Reader::fetchAssoc callable argument expects an indexed row using the submitted keys as its first argument
    • Reader::fetchColumn callable argument expects the selected column value as its first argument
    • Default value on setOutputBOM is removed
    • AbstractCsv::getOutputBOM always return a string
    • AbstractCsv::getInputBOM always return a string

    Removed

    • Controls::setFlags
    • Controls::getFlags
    • Controls::detectDelimiterList
    • QueryFilter::removeFilter
    • QueryFilter::removeSortBy
    • QueryFilter::hasFilter
    • QueryFilter::hasSortBy
    • QueryFilter::clearFilter
    • QueryFilter::clearSortBy
    • Reader::query
    • The $newline argument from AbstractCsv::createFromString
    Open source →
  54. 7.2.0 02 Nov 2015
    Release notes

    Added

    • Reader::fetch replaces League\Csv\Reader::query for naming consistency
    • Controls::fetchDelimitersOccurrence to replace Controls::detectDelimiterList the latter gives erronous results

    Deprecated

    • Controls::detectDelimiterList
    • Reader::query
    • The $newline argument from AbstractCsv::createFromString

    Fixed

    • Streamming feature no longer trim filter name argument issue #122
    • Fix default SplFileObject flags usage PR #130
    • AbstractCsv::createFromString no longer trim the submitted string issue #132

    Removed

    • Nothing
    Open source →
  55. 7.1.2 10 Jun 2015
    Release notes

    Added

    • Nothing

    Deprecated

    • Nothing

    Fixed

    • Enclosures should be removed when a BOM sequence is stripped issue #102

    Removed

    • Nothing
    Open source →
  56. 7.1.1 20 May 2015
    Release notes

    Added

    • Nothing

    Deprecated

    • Nothing

    Fixed

    • SplFileObject flags were not always applied using query filter issue #99

    Removed

    • Nothing
    Open source →
  57. 7.1.0 06 May 2015
    Release notes

    Added

    • stripBOM query filtering method to ease removing the BOM sequence when querying the CSV document.
    • All query filters are now accessible in the Writer class for conversion methods.

    Deprecated

    • Nothing

    Fixed

    • Internal code has been updated to take into account issue #68479
    • setFlags on conversion methods SplFileObject default flags are SplFileObject::READ_AHEAD|SplFileObject::SKIP_EMPTY
    • insertOne now takes into account the escape character when modified after the first insert.

    Removed

    • Nothing
    Open source →
  58. 7.0.1 23 Mar 2015
    Release notes

    Added

    • Nothing

    Deprecated

    • Nothing

    Fixed

    • setFlags: SplFileObject::DROP_NEW_LINE can be remove using setFlags method.

    Removed

    • Nothing
    Open source →
  59. 7.0.0 19 Feb 2015
    Release notes

    Added

    • A new flexible mechanism to format and validate a row before its insertion by adding
      • Writer::addFormatter to add a formatter to the Writer object
      • Writer::removeFormatter to remove an already registered formatter
      • Writer::hasFormatter to detect the presence of a formatter
      • Writer::clearFormatters to clear all registered formatter
      • Writer::addValidator to add a validator to the Writer object
      • Writer::removeValidator to remove an already registered validator
      • Writer::hasValidator to detect the presence of a validator
      • Writer::clearValidators to clear all registered validator
      • League\Csv\Exception\InvalidRowException exception thrown when row validation failed
    • Classes to maintain removed features from the Writer class
      • League\Csv\Plugin\ColumnConsistencyValidator to validate column consistency on insertion
      • League\Csv\Plugin\ForbiddenNullValuesValidator to validate null value on insertion
      • League\Csv\Plugin\SkipNullValuesFormatter to format null value on insertion

    Deprecated

    • Nothing

    Fixed

    • jsonSerialize, toXML and toHTML output can be modified using Reader query options methods.
    • AbstractCSV::detectDelimiterList index keys now represents the occurrence of the found delimiter.
    • getNewline and setNewline are accessible on the Reader class too.
    • the named constructor createFromString now accepts the $newline sequence as a second argument to specify the last added new line character to better work with interoperability.
    • Default value on CSV controls setter methods setDelimiter, setEnclosure and setEscape are removed
    • Default SplFileObject flags value is now SplFileObject::READ_CSV|SplFileObject::DROP_NEW_LINE
    • All CSV properties are now copied when using newReader and newWriter methods
    • BOM addition on output improved by removing if found the existing BOM character
    • the AbstractCSV::output method now returns the number of bytes send to the output buffer
    • Reader::fetchColumn will automatically filter out non existing values from the return array

    Removed

    • Setting ini_set("auto_detect_line_endings", true); is no longer set in the class constructor. Mac OS X users must explicitly set this ini options in their script.
    • Writer and Reader default constructor are removed from public API in favor of the named constructors.
    • All Writer methods and constant related to CSV data validation and formatting before insertion
      • Writer::getNullHandlingMode
      • Writer::setNullHandlingMode
      • Writer::setColumnsCount
      • Writer::getColumnsCount
      • Writer::autodetectColumnsCount
      • Writer::NULL_AS_EXCEPTION
      • Writer::NULL_AS_EMPTY
      • Writer::NULL_AS_SKIP_CELL
    Open source →
  60. 6.3.0 21 Jan 2015
    Release notes

    Added

    • AbstractCSV::setOutputBOM
    • AbstractCSV::getOutputBOM
    • AbstractCSV::getInputBOM

    to manage BOM character with CSV.

    Deprecated

    • Nothing

    Fixed

    • Nothing

    Removed

    • Nothing
    Open source →

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive