Skip to content

Version 0.32.0

Choose a tag to compare

@veewee veewee released this 27 Mar 13:37
· 2 commits to main since this release
0.32.0
acaca46

Upgrade to veewee/xml v4 and PHP 8.4+

This release migrates the package to PHP 8.4's spec-compliant DOM API via veewee/xml ^4.10.

Requirements

  • PHP 8.4+ (dropped 8.3 support)
  • veewee/xml ^4.10
  • Standalone PSL packages ^6.1 (replaces the monolith php-standard-library/php-standard-library)

Breaking Changes

  • Element::fromDOMElement() and Element::element() now accept/return Dom\Element instead of DOMElement
  • XsiTypeDetector::detectXsdTypeFromXmlElement() and detectEncoderFromXmlElement() accept Dom\Element instead of DOMElement
  • ElementValueReader methods accept Dom\Element instead of DOMElement
  • SOAP 1.2 fault detail serialization may produce namespace declarations in a different order (alphabetical, per the new DOM spec)

Dependency Bumps

Package From To
php-soap/engine ^2.19 ^2.20
php-soap/wsdl ^1.18 ^1.19
php-soap/xml ^1.9 ^1.10
php-soap/wsdl-reader ^0.31 ^0.32
php-soap/psr18-transport ^1.8 ^2.0
php-soap/engine-integration-tests ^1.10 ^1.12

DOM Migration Details

  • All legacy DOMDocument, DOMElement, DOMNode, DOMAttr type hints replaced with Dom\ namespace equivalents
  • Deprecated Document::configure(loader(...)) replaced with Document::fromLoader()
  • getAttribute() / getAttributeNS() now return null instead of '' for missing attributes (handled throughout)
  • textContent is now ?string (null-guarded in fault encoders)
  • ownerDocument access uses assert_document() (returns ?Dom\Document, not ?Dom\XMLDocument)
  • DOM stubs added to psalm.xml for static analysis support

Performance

Encoding (PHP values to XML) is 12-16% faster, and memory usage dropped ~7% across the board.

Decoding (XML to PHP values) shows a small regression in SOAP encoded mode:

Benchmark Change
Literal decode unchanged (+0.4%)
Encoded decode +7-9%

The encoded decode regression is caused by PHP 8.4's new Dom\ implementation being marginally slower per-operation on XPath queries (+22%), node iteration (+11%), and XML parsing (+2%). These small differences compound through the encoded decode path, which performs ~2x more DOM interactions than literal mode (xsi:type attribute reads, namespace resolution on every element). This is a PHP engine characteristic, not something fixable at the library level, and may improve in future PHP releases. (/cc @ndossche)

In real-world usage, the encoded decode overhead translates to roughly 15-20 microseconds per decoded message, which is negligible compared to network latency.

What's Changed

  • Migrate to veewee/xml v4 and PHP 8.4+ by @veewee in #58

Full Changelog: 0.31.0...0.32.0