php-soap/encoding
SOAP encoding and decoding package
0.34.0
498K downloads/mo
#3989 most downloaded on Packagist
php-soap/encoding
What this package is like to depend on
Last release 2 months ago
27 May 2026
Release timing varies
gaps range from 9 days to 5 months
Some releases are documented
notes for 10 of 38 stable releases
Nothing withdrawn
no release was ever pulled
2 years old
38 releases · first in 2024
14 releases in the last 12 months
see the full history below
Release timeline
38 releases · Jun 2024 to May 2026Releases
latest 38-
0.34.027 May 2026Release notes
Open source →What's Changed
Warning
Custom encoders need updating. Reflecta's optics moved from 2 type parameters to 4, the STAB form:
Iso<S, T, A, B>andLens<S, T, A, B>. If you wrote your ownXmlEncoder,SoapMethodEncoder, or anything implementing theProvides*LensorDecoratingEncoderfeatures, widen your generic annotations from 2 to 4 parameters.SandAkeep their old meaning (the whole, and the focus).TandBare the write-side counterparts, used when a write changes the type. If yours never does, just repeat them:XmlEncoder<Data, Data, Xml, Xml>.Nothing changes at runtime. Method signatures are the same, so any code without explicit Psalm/PHPDoc annotations keeps working as is. The Reflecta 1.0.0 upgrade guide walks through the rest.
Full Changelog: 0.33.0...0.34.0
-
0.33.003 Apr 2026 -
0.32.027 Mar 2026Release notes
Open source →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()andElement::element()now accept/returnDom\Elementinstead ofDOMElementXsiTypeDetector::detectXsdTypeFromXmlElement()anddetectEncoderFromXmlElement()acceptDom\Elementinstead ofDOMElementElementValueReadermethods acceptDom\Elementinstead ofDOMElement- 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,DOMAttrtype hints replaced withDom\namespace equivalents - Deprecated
Document::configure(loader(...))replaced withDocument::fromLoader() getAttribute()/getAttributeNS()now returnnullinstead of''for missing attributes (handled throughout)textContentis now?string(null-guarded in fault encoders)ownerDocumentaccess usesassert_document()(returns?Dom\Document, not?Dom\XMLDocument)- DOM stubs added to
psalm.xmlfor 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
Full Changelog: 0.31.0...0.32.0
-
0.31.121 Apr 2026 -
0.31.026 Mar 2026Release notes
Open source →Performance Release
This release focuses entirely on encoding/decoding performance. No breaking changes.
What changed
A series of targeted caching improvements were introduced across the encoder pipeline. Each fix eliminates redundant object construction on repeated calls to
iso()within a single request.Merged PRs
PR Change #52 Cache inner IsoinXsiTypeEncoderto avoid redundantiso()calls#53 Cache type IsoinElementEncoder; refactorElementValueBuilderandElementValueReader#55 Cache type IsoinAttributeValueEncoder#56 Cache FixedIsoEncoderper xsi:type inXsiTypeDetector; introduceScopedCache; refactorEncoderDetector#57 Cache ObjectAccess::forContext()by type+namespace+bindingUse (largest single win)Bumping
veewee/reflectato^0.17also contributes a small improvement via aproperties_setclone-once optimization (reflecta#26).Benchmark results
Benchmarks run with phpbench on PHP 8.4, using a complex SOAP type with nested objects. WSDL parsing is excluded from measurements (
@BeforeMethods). The baseline is the commit where benchmarks were introduced (before any optimizations).Encoding
Benchmark Baseline Optimized Improvement Literal — 1 item 126.2 μs 91.1 μs -28% Literal — 500 items 62.3 ms 44.7 ms -28% Encoded — 1 item 174.4 μs 140.0 μs -20% Encoded — 500 items 86.6 ms 69.1 ms -20% Decoding
Benchmark Baseline Optimized Improvement Literal — 1 item 178.7 μs 132.4 μs -26% Literal — 500 items 90.0 ms 68.5 ms -24% Encoded — 1 item 250.5 μs 167.6 μs -33% Encoded — 500 items 129.5 ms 83.0 ms -36% Comparison with ext-soap
For context,
ext-soap(C extension) measured on the same machine:Operation ext-soap php-soap/encoding Ratio Encode literal — 1 item 7.6 μs 91.1 μs ~12x slower Encode encoded — 1 item 12.5 μs 140.0 μs ~11x slower Decode literal — 1 item 11.3 μs 132.4 μs ~12x slower Decode encoded — 1 item 16.3 μs 167.6 μs ~10x slower The gap vs ext-soap is expected:
php-soap/encodingoperates at the PHP level and provides full type-safety and WSDL-driven encoding as a pure PHP implementation.Upgrade notes
- Minimum
veewee/reflectaversion bumped to^0.17. - No changes to public API. Drop-in upgrade.
- The new
ScopedCacheclass (Soap\Encoding\Cache\ScopedCache) is@internal.
What's Changed
- Add phpbench benchmarks with CI regression detection by @veewee in #51
- Cache inner iso in XsiTypeEncoder by @veewee in #52
- Cache type iso in ElementEncoder, refactor value builder/reader by @veewee in #53
- Cache type iso in AttributeValueEncoder by @veewee in #55
- Cache xsi:type encoder detection in XsiTypeDetector by @veewee in #56
- Cache ObjectAccess::forContext() using ScopedCache by @veewee in #57
Full Changelog: 0.30.0...0.31.0
- Minimum
-
0.30.025 Mar 2026 -
0.29.024 Mar 2026Release notes
Open source →What's Changed
- Fix xsi:type namespace resolution for server-side prefixes by @veewee in #49
- Fix base64Binary decoding for unpadded and whitespace-containing input by @veewee in #47
Full Changelog: 0.28.0...0.29.0
-
0.28.019 Mar 2026 -
0.27.011 Mar 2026 -
0.26.017 Dec 2025 -
0.25.005 Dec 2025Nothing published for this version
-
0.24.025 Nov 2025Nothing published for this version
-
0.23.020 Oct 2025Nothing published for this version
-
0.22.026 Sep 2025Nothing published for this version
-
0.21.017 Jul 2025Nothing published for this version
-
0.20.012 Feb 2025Nothing published for this version
-
0.19.007 Feb 2025Nothing published for this version
-
0.18.012 Jan 2025Nothing published for this version
-
0.17.010 Jan 2025Nothing published for this version
-
0.16.003 Jan 2025Nothing published for this version
-
0.15.120 Dec 2024Nothing published for this version
-
0.15.020 Dec 2024Nothing published for this version
-
0.14.019 Dec 2024Nothing published for this version
-
0.13.025 Oct 2024Nothing published for this version
-
0.12.030 Sep 2024Nothing published for this version
-
0.11.003 Sep 2024Nothing published for this version
-
0.10.030 Aug 2024Nothing published for this version
-
0.9.101 Aug 2024Nothing published for this version
-
0.9.001 Aug 2024Nothing published for this version
-
0.8.024 Jul 2024Nothing published for this version
-
0.7.020 Jul 2024Nothing published for this version
-
0.6.014 Jun 2024Nothing published for this version
-
0.5.013 Jun 2024Nothing published for this version
-
0.4.112 Jun 2024Nothing published for this version
-
0.4.011 Jun 2024Nothing published for this version
-
0.3.011 Jun 2024Nothing published for this version
-
0.2.010 Jun 2024Nothing published for this version
-
0.1.010 Jun 2024Nothing published for this version