PackageTrack
Sign in Get early access

sabre/xml

sabre/xml is an XML library that you may not hate.

4.1.0 36M downloads/mo #681 most downloaded on Packagist sabre-io/xml

What this package is like to depend on

Last release 3 months ago

27 Apr 2026

Release timing varies

gaps range from 8 days to 1.6 years

Nearly every release is documented

notes for 58 of 61 stable releases

Nothing withdrawn

no release was ever pulled

14 years old

61 releases · first in 2013

3 releases in the last 12 months

see the full history below

Release timeline

60 releases · Feb 2013 to Apr 2026
2014 2016 2018 2020 2022 2024 2026
Release Pre-release

Releases

latest 60 of 61
  1. 4.1.0 27 Apr 2026
    Release notes

    4.1.0 (2026-04-27)

    This release supports PHP 8.2 and up. That is specified in composer.json so consumers should automatically select it only for projects that have minimum PHP 8.2 support.

    The 4.0.* release series, supporting PHP 7.4 8.0 8.1, will have bugfixes backported if relevant/needed for some time.

    Open source →
    Release notes
    • #325 chore: support PHP 8.2 and up ( @phil-davis )
    • *326 chore: remove phpVersion from phpstan.neon ( @phil-davis )
    Open source →
  2. 4.0.7 02 Apr 2026
    Release notes

    4.0.7 (2026-04-02)

    Open source →
    Release notes
    • #305 phpstan major version 2 ( @phil-davis )
    • *317 add rector and run in CI ( @phil-davis )
    Open source →
  3. 4.0.6 06 Sep 2024
    Release notes

    4.0.6 (2024-09-06)

    Open source →
    Release notes
    • #281 delete unused bin directory ( @szepeviktor )
    • #282 stop exporting php-cs-fixer config ( @szepeviktor )
    • #298 fix for passing a closed resource to Service parse or expect (@phil-davis)
    Open source →
  4. 4.0.5 18 Apr 2024
    Release notes
    • #270 Fixed handling of elements from foreign namespaces in values object ( @mrbig )
    • #271 Code format changes for php-cs-fixer 3.51 ( @phil-davis )
    • #272 More precise parseClarkNotation return type ( @staabm )
    Open source →
  5. 4.0.4 09 Nov 2023
    Release notes
    • #260 fix: more return type declarations on xmlDeserialize ( @DeepDiver1975 )
    Open source →
  6. 4.0.3 09 Nov 2023
    Release notes
    • #258 fix: return type of XmlFragment::xmlDeserialize to match base declaration ( @DeepDiver1975 )
    Open source →
  7. 4.0.2 28 Jun 2023
    Release notes
    • #247 Enhance PHPdoc of Service write value parameter ( @phil-davis )
    Open source →
  8. 4.0.1 28 Jun 2023
    Release notes
    • #229 Fixed error where valueobject has eaten too much ( @mrbig )
    • #238 cs-fixer and CI updates ( @phil-davis )
    • #234 Call static assert functions with self:: tests-only ( @phil-davis )
    • #231 Adjust code style to meet current php-cs-fixer ( @phil-davis )
    Open source →
  9. 4.0.0 26 Sep 2022
    Release notes
    • #226 Allow sabre/uri major version 3 ( @phil-davis )
    Open source →
  10. 3.0.7 02 Apr 2026
    Release notes

    3.0.7 (2026-04-02)

    Open source →
    Release notes
    • #318 phpstan major version 2 (@phil-davis)
    • *320 add rector and run in CI (@phil-davis)
    Open source →
  11. 3.0.6 06 Sep 2024
    Release notes

    3.0.6 (2024-09-06)

    • #298 fix for passing a closed resource to Service parse or expect (@phil-davis)
    Open source →
    Release notes
    • #298 fix for passing a closed resource to Service parse or expect (@phil-davis)
    Open source →
  12. 3.0.5 05 Sep 2024
    Release notes

    3.0.5 (2024-09-05)

    Open source →
    Release notes
    • #294 Add PHP 8.4 compliance for v3 branch ( @phil-davis )
    Open source →
  13. 3.0.4 18 Apr 2024
    Release notes
    • #270 Fixed handling of elements from foreign namespaces in values object ( @mrbig )
    • #272 More precise parseClarkNotation return type ( @staabm )
    Open source →
  14. 3.0.3 09 Nov 2023
    Release notes
    • #262 Backport fix: return type of XmlFragment::xmlDeserialize to match base declaration ( @phil-davis )
    Open source →
  15. 3.0.2 28 Jun 2023
    Release notes
    • #247 Enhance PHPdoc of Service write value parameter ( @phil-davis )
    Open source →
  16. 3.0.1 28 Jun 2023
    Release notes
    • #229 Fixed error where valueobject has eaten too much ( @mrbig )
    • #239 cs-fixer and CI updates ( @phil-davis )
    Open source →
  17. 3.0.0 17 Aug 2022
    Release notes
    • #220 Set minimum PHP to 7.4 and declare types ( @phil-davis )
    • #219 Update .gitattributes ( @cedric-anne )
    • #217 Declare types ( @staabm )
    • #213 added phpstan types to deserializer functions ( @staabm )
    • #214 update phpstan 1.x ( @staabm )
    Open source →
  18. 2.2.11 06 Sep 2024
    Release notes

    2.2.11 (2024-09-06)

    • #298 fix for passing a closed resource to Service parse or expect (@phil-davis)
    Open source →
    Release notes
    • #298 fix for passing a closed resource to Service parse or expect (@phil-davis)
    Open source →
  19. 2.2.10 27 Aug 2024
    Release notes

    2.2.10 (2024-08-27)

    Contains code style changes applied by php-cs-fixer major version 3.
    No changes to behavior.

    Open source →
    Release notes
    • #290 add cs-fixer v3 (@phil-davis)
    Open source →
  20. 2.2.9 26 Jul 2024
    Release notes

    2.2.9 (2024-07-26)

    Open source →
    Release notes
    • #287 Explicitly mark nullable parameter (@cedric-anne)
    Open source →
  21. 2.2.8 25 Jul 2024
    Release notes

    2.2.8 (2024-07-25)

    Open source →
    Release notes
    • #284 Add PHP 8.2 and 8.3 to CI for 2.2 branch (@phil-davis)
    • #285 PHP 8.4 compliance (@phil-davis)
    Open source →
  22. 2.2.7 18 Apr 2024
    Release notes
    • #270 Fixed handling of elements from foreign namespaces in values object ( @mrbig )
    Open source →
  23. 2.2.6 28 Jun 2023
    Release notes
    • #229 Fixed error where valueobject has eaten too much ( @mrbig )
    Open source →
  24. 2.2.5 04 Nov 2021
    Release notes
    • #210 version bump that was missed in 2.2.4 ( @phil-davis )
    Open source →
  25. 2.2.4 03 Nov 2021
    Release notes
    • #204 Use libxml version instead of PHP version before calling libxml_disable_entity_loader ( @CarlSchwan )
    Open source →
  26. 2.2.3 03 Oct 2020
    Release notes
    • #191: add changelog and version bump that was missed in 2.2.2
    Open source →
  27. 2.2.2 03 Oct 2020
    Release notes
    • #190: adjust libxml_disable_entity_loader calls ready for PHP 8.0 (@phil-davis)
    Open source →
  28. 2.2.1 11 May 2020
    Release notes
    • #183: fixed warning 'xml cannot be empty while reading', which might lead to an infinite-loop (@mrow4a)
    • #179, #178, #177 #176: several build/continuous integration related improvements (@phil-davis)
    Open source →
  29. 2.2.0 31 Jan 2020
    Release notes
    • #171: Added Support for PHP 7.4, dropped Support for PHP 7.0 (@staabm, @phil-davis)
    • #174: Update testsuite to phpunit8 (@phil-davis)
    • Added phpstan coverage (@phil-davis)
    • #144: Added a new functionCaller deserializer function for executing a callable when reading an XML element (@vsouz4)
    Open source →
  30. 2.1.3 14 Aug 2019
    Release notes
    • #166: Throw exception when empty inputs found
    Open source →
  31. 2.1.2 09 Jan 2019
    Release notes
    • #161: Prevent infinite loop on empty xml elements
    Open source →
  32. 2.1.1 09 Oct 2018
    Release notes
    • #149: Properly detect xml parse errors in parseCurrentElement() edge-cases
    Open source →
  33. 2.1.0 08 Feb 2018
    Release notes
    • #112: Added a mixedContent deserializer function, which might be useful if you're parsing HTML-like documents with elements that contain both text and other elements as siblings. (@staabm).
    Open source →
  34. 2.0.2 09 Oct 2018

    Nothing published for this version

  35. 2.0.1 no date

    Nothing published for this version

  36. 2.0.0 16 Nov 2016
    Release notes
    • Now requires PHP 7.
    • Uses typehints everywhere.
    • Fixed some minor strict typing-related issues.
    • Removed workaround for PHP bug 64230.
    Open source →
  37. 1.5.1 09 Jan 2019

    Nothing published for this version

  38. 1.5.0 09 Oct 2016
    Release notes
    • Now requires PHP 5.5.
    • Using finally to always roll back the context stack when serializing.
    • #94: Fixed an infinite loop condition when reading some invalid XML documents.
    Open source →
  39. 1.4.2 19 May 2016
    Release notes
    • The contextStack in the Reader object is now correctly rolled back in error conditions (@staabm).
    • repeatingElements deserializer now still parses if a bare element name without clark notation was given.
    • $elementMap in the Reader now also supports bare element names.
    • Service::expect() can now also work with bare element names.
    Open source →
  40. 1.4.1 12 Mar 2016
    Release notes
    • Parsing clark-notation is now cached. This can speed up parsing large documents with lots of repeating elements a fair bit. (@icewind1991).
    Open source →
  41. 1.4.0 14 Feb 2016
    Release notes
    • Any array thrown into the serializer with numeric keys is now simply traversed and each individual item is serialized. This fixes an issue related to serializing value objects with array children.
    • When serializing value objects, properties that have a null value or an empty array are now skipped. We believe this to be the saner default, but does constitute a BC break for those depending on this.
    • Serializing array properties in value objects was broken.
    Open source →
  42. 1.3.0 29 Dec 2015
    Release notes
    • The Service class adds a new mapValueObject method which provides basic capabilities to map between ValueObjects and XML.
    • #61: You can now specify serializers for specific classes, allowing you separate the object you want to serialize from the serializer. This uses the $classMap property which is defined on both the Service and Writer.
    • It's now possible to pass an array of possible root elements to Sabre\Xml\Service::expect().
    • Moved some parsing logic to Reader::getDeserializerForElementName(), so people with more advanced use-cases can implement their own logic there.
    • #63: When serializing elements using arrays, the value key in the array is now optional.
    • #62: Added a keyValue deserializer function. This can be used instead of the Element\KeyValue class and is a lot more flexible. (@staabm)
    • Also added an enum deserializer function to replace Element\Elements.
    • Using an empty string for a namespace prefix now has the same effect as null.
    Open source →
  43. 1.2.0 30 Aug 2015
    Release notes
    • #53: Added parseGetElements, a function like parseInnerTree, except that it always returns an array of elements, or an empty array.
    Open source →
  44. 1.1.0 29 Jun 2015
    Release notes
    • #44, #45: Catching broken and invalid XML better and throwing Sabre\Xml\LibXMLException whenever we encounter errors. (@stefanmajoor, @DaanBiesterbos)
    Open source →
  45. 1.0.0 26 May 2015
    Release notes
    • No functional changes since 0.4.3. Marking it as 1.0.0 as a promise for API stability.
    • Using php-cs-fixer for automated CS enforcement.
    Open source →
  46. 0.4.3 01 Apr 2015
    Release notes
    • Minor tweaks for the public release.
    Open source →
  47. 0.4.2 21 Mar 2015
    Release notes
    • Removed constants.php again. They messed with PHPUnit and don't really provide a great benefit.
    • #41: Correctly handle self-closing xml elements.
    Open source →
  48. 0.4.1 19 Mar 2015
    Release notes
    • #40: An element with an empty namespace (xmlns="") is not allowed to have a prefix. This is now fixed.
    Open source →
  49. 0.4.0 19 Mar 2015
    Release notes
    • Added Sabre\Xml\Service. This is intended as a simple way to centrally configure xml applications and easily parse/write things from there. #35, #38.
    • Renamed 'baseUri' to 'contextUri' everywhere.
    • #36: Added a few convenience constants to lib/constants.php.
    • Sabre\Xml\Util::parseClarkNotation is now in the Sabre\Xml\Service class.
    Open source →
  50. 0.3.1 09 Feb 2015
    Release notes
    • Added XmlDeserializable to match XmlSerializable.
    Open source →
  51. 0.3.0 06 Feb 2015
    Release notes
    • Added $elementMap argument to parseInnerTree, for quickly overriding parsing rules within an element.
    Open source →
  52. 0.2.2 05 Feb 2015
    Release notes
    • Now depends on sabre/uri 1.0.
    Open source →
  53. 0.2.1 17 Dec 2014
    Release notes
    • LibXMLException now inherits from ParseException, so it's easy for users to catch any exception thrown by the parser.
    Open source →
  54. 0.2.0 05 Dec 2014
    Release notes
    • Major BC Break: method names for the Element interface have been renamed from serializeXml and deserializeXml to xmlSerialize and xmlDeserialize. This is so that it matches PHP's JsonSerializable interface.
    • #25: Added XmlSerializable to allow people to write serializers without having to implement a deserializer in the same class.
    • #26: Renamed the Sabre\XML namespace to Sabre\Xml. Due to composer magic and the fact that PHP namespace are case-insensitive, this should not affect anyone, unless you are doing exact string matches on class names.
    • #23: It's not possible to automatically extract or serialize Xml fragments from documents using Sabre\Xml\Element\XmlFragment.
    Open source →
  55. 0.1.0 24 Nov 2014
    Release notes
    • #16: Added ability to override elementMap, namespaceMap and baseUri for a fragment of a document during reading and writing using pushContext and popContext.
    • Removed: Writer::$context and Reader::$context.
    • #15: Added Reader::$baseUri to match Writer::$baseUri.
    • #20: Allow callbacks to be used instead of Element classes in the Reader.
    • #25: Added readText to quickly grab all text from a node and advance the reader to the next node.
    • #15: Added Sabre\XML\Element\Uri.
    Open source →
  56. 0.0.6 26 Sep 2014
    Release notes
    • Added: CData element.
    • #13: Better support for xml with no namespaces. (@kalmas)
    • Switched to PSR-4 directory structure.
    Open source →
  57. 0.0.5 27 Mar 2013
    Release notes
    • Added: baseUri property to the Writer class.
    • Added: The writeElement method can now write complex elements.
    • Added: Throwing exception when invalid objects are written.
    Open source →
  58. 0.0.4 14 Mar 2013
    Release notes
    • Fixed: The KeyValue parser was skipping over elements when there was no whitespace between them.
    • Fixed: Clearing libxml errors after parsing.
    • Added: Support for CDATA.
    • Added: Context properties.
    Open source →
  59. 0.0.3 22 Feb 2013
    Release notes
    • Changed: Reader::parse returns an array with 1 level less depth.
    • Added: A LibXMLException is now thrown if the XMLReader comes across an error.
    • Fixed: Both the Elements and KeyValue parsers had severe issues with nesting.
    • Fixed: The reader now detects when the end of the document is hit before it should (because we're still parsing an element).
    Open source →
  60. 0.0.2 17 Feb 2013
    Release notes
    • Added: Elements parser.
    • Added: KeyValue parser.
    • Change: Reader::parseSubTree is now named parseInnerTree, and returns either a string (in case of a text-node), or an array (in case there were child elements).
    • Added: Reader::parseCurrentElement is now public.
    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