NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist · #690 most downloaded on Packagist
sabre/xml is an XML library that you may not hate.
Last release 5 months ago
27 Apr 2026
Release timing varies
gaps range from 8 days to 1.6 years
Nearly every release is documented
notes for 57 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
14 years old
61 releases · first in 2013
*326 chore: remove phpVersion from phpstan.neon ( @phil-davis )
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.
4.0.7 (2026-04-02) #305 phpstan major version 2 ( @phil-davis ) #317 add rector and run in CI ( @phil-davis )
One column per quarter.
4.0.6 (2024-09-06) #281 delete unused bin directory ( @szepeviktor ) #282 stop exporting php-cs-fixer config ( @szepeviktor ) #298 fix for passing a c
* #270 Fixed handling of elements from foreign namespaces in values object ( @mrbig ) * #271 Code format changes for php-cs-fixer 3.51 ( @phil-davis )
* #260 fix: more return type declarations on xmlDeserialize ( @DeepDiver1975 )
* #258 fix: return type of XmlFragment::xmlDeserialize to match base declaration ( @DeepDiver1975 )
* #247 Enhance PHPdoc of Service write value parameter ( @phil-davis )
* #229 Fixed error where valueobject has eaten too much ( @mrbig ) * #238 cs-fixer and CI updates ( @phil-davis ) * #234 Call static assert functions
* #226 Allow sabre/uri major version 3 ( @phil-davis )
3.0.7 (2026-04-02) #318 phpstan major version 2 ( @phil-davis ) #320 add rector and run in CI ( @phil-davis )
3.0.6 (2024-09-06) #298 fix for passing a closed resource to Service parse or expect ( @phil-davis )
3.0.5 (2024-09-05) #294 Add PHP 8.4 compliance for v3 branch ( @phil-davis )
* #270 Fixed handling of elements from foreign namespaces in values object ( @mrbig ) * #272 More precise parseClarkNotation return type ( @staabm )
* #262 Backport fix: return type of XmlFragment::xmlDeserialize to match base declaration ( @phil-davis )
* #247 Enhance PHPdoc of Service write value parameter ( @phil-davis )
* #229 Fixed error where valueobject has eaten too much ( @mrbig ) * #239 cs-fixer and CI updates ( @phil-davis )
* #220 Set minimum PHP to 7.4 and declare types ( @phil-davis ) * #219 Update .gitattributes ( @cedric-anne ) * #217 Declare types ( @staabm ) * #213
2.2.11 (2024-09-06) #298 fix for passing a closed resource to Service parse or expect ( @phil-davis )
Contains code style changes applied by php-cs-fixer major version 3. No changes to behavior.
Contains code style changes applied by php-cs-fixer major version 3.
No changes to behavior.
2.2.9 (2024-07-26) #287 Explicitly mark nullable parameter ( @cedric-anne )
2.2.8 (2024-07-25) #284 Add PHP 8.2 and 8.3 to CI for 2.2 branch ( @phil-davis ) #285 PHP 8.4 compliance ( @phil-davis )
* #270 Fixed handling of elements from foreign namespaces in values object ( @mrbig )
* #229 Fixed error where valueobject has eaten too much ( @mrbig )
* #210 version bump that was missed in 2.2.4 ( @phil-davis )
* #204 Use libxml version instead of PHP version before calling libxml_disable_entity_loader ( @CarlSchwan )
* #191: add changelog and version bump that was missed in 2.2.2
* #190: adjust libxml_disable_entity_loader calls ready for PHP 8.0 (@phil-davis)
* #183: fixed warning 'xml cannot be empty while reading', which might lead to an infinite-loop (@mrow4a) * #179, #178, #177 #176: several build/conti
Added phpstan coverage (@phil-davis)
functionCaller deserializer function for executing a callable when reading an XML
element (@vsouz4)* #166: Throw exception when empty inputs found
* #161: Prevent infinite loop on empty xml elements
* #149: Properly detect xml parse errors in parseCurrentElement() edge-cases
parseCurrentElement() edge-cases* #112: Added a mixedContent deserializer function, which might be useful if you're parsing HTML-like documents with elements that contain both text 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).Nothing published for this version
Nothing published for this version
Fixed some minor strict typing-related issues.
Nothing published for this version
Using finally to always roll back the context stack when serializing.
finally to always roll back the context stack when serializing.The contextStack in the Reader object is now correctly rolled back in error conditions (@staabm).
contextStack in the Reader object is now correctly rolled back in
error conditions (@staabm).$elementMap in the Reader now also supports bare element names.Service::expect() can now also work with bare element names.Parsing clark-notation is now cached. This can speed up parsing large documents with lots of repeating elements a fair bit. (@icewind1991).
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
The Service class adds a new mapValueObject method which provides basic capabilities to map between ValueObjects and XML.
Service class adds a new mapValueObject method which provides basic
capabilities to map between ValueObjects and XML.$classMap property which is defined on both the Service and Writer.Sabre\Xml\Service::expect().Reader::getDeserializerForElementName(),
so people with more advanced use-cases can implement their own logic there.value key in the array is
now optional.keyValue deserializer function. This can be used instead of
the Element\KeyValue class and is a lot more flexible. (@staabm)enum deserializer function to replace
Element\Elements.null.* #53: Added parseGetElements, a function like parseInnerTree, except that it always returns an array of elements, or an empty array.
parseGetElements, a function like parseInnerTree, except
that it always returns an array of elements, or an empty array.* #44, #45: Catching broken and invalid XML better and throwing Sabre\Xml\LibXMLException whenever we encounter errors. (@stefanmajoor, @DaanBiesterbo
Sabre\Xml\LibXMLException whenever we encounter errors. (@stefanmajoor,
@DaanBiesterbos)No functional changes since 0.4.3. Marking it as 1.0.0 as a promise for API stability.
Minor tweaks for the public release.
Removed constants.php again. They messed with PHPUnit and don't really provide a great benefit.
constants.php again. They messed with PHPUnit and don't really
provide a great benefit.* #40: An element with an empty namespace (xmlns="") is not allowed to have a prefix. This is now fixed.
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.
Sabre\Xml\Service. This is intended as a simple way to centrally
configure xml applications and easily parse/write things from there. #35, #38.lib/constants.php.Sabre\Xml\Util::parseClarkNotation is now in the Sabre\Xml\Service class.Added XmlDeserializable to match XmlSerializable.
XmlDeserializable to match XmlSerializable.Added $elementMap argument to parseInnerTree, for quickly overriding parsing rules within an element.
$elementMap argument to parseInnerTree, for quickly overriding
parsing rules within an element.* Now depends on sabre/uri 1.0.
LibXMLException now inherits from ParseException, so it's easy for users to catch any exception thrown by the parser.
Major BC Break: method names for the Element interface have been renamed from serializeXml and deserializeXml to xmlSerialize and xmlDeserialize. This
serializeXml and deserializeXml to xmlSerialize and
xmlDeserialize. This is so that it matches PHP's JsonSerializable
interface.XmlSerializable to allow people to write serializers without
having to implement a deserializer in the same class.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.Sabre\Xml\Element\XmlFragment.Removed: Writer::$context and Reader::$context.
elementMap, namespaceMap and baseUri for
a fragment of a document during reading and writing using pushContext and
popContext.Writer::$context and Reader::$context.Reader::$baseUri to match Writer::$baseUri.Element classes in the Reader.readText to quickly grab all text from a node and advance the
reader to the next node.Sabre\XML\Element\Uri.Switched to PSR-4 directory structure.
CData element.Added: baseUri property to the Writer class.
Fixed: The KeyValue parser was skipping over elements when there was no whitespace between them.
Changed: Reader::parse returns an array with 1 level less depth.
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
Your coding agent can read these notes before it upgrades. Set up the MCP server →