NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist
Packagist, #2804 most downloaded on Packagist
SOAP encoding and decoding package
Latest stable
0.36.0
Last release 1 months ago
16 Oct 2026
Release timing varies
gaps range from 9 days to 3 months
Nearly every release is documented
notes for 40 of 40 stable releases
Nothing withdrawn
no release was ever pulled
2 years old
40 releases · first in 2024
Drag across the ruler to compare, or tap a release to open it.
This release removes the intermediate exceptions from encoding and decoding, decodes through a new ElementLookup, and makes the library a lot faster o
This release removes the intermediate exceptions from encoding and decoding, decodes through a new ElementLookup, and makes the library a lot faster on large payloads.
xsi:nil. Set the property to null to keep sending the nil. (#79)ProvidesObjectDecoderLens lenses now receive Soap\Encoding\Xml\Node\ElementLookup instead of the lookup array. Read $lookup->element('name') or $lookup->attribute('name', $namespace) where you read $data['name']. (#80)DocumentToLookupArrayReader is removed. Use ElementLookup::fromElement($element). (#80)ref are written in their own namespace, for example xml:lang and tns:code. This follows XSD and differs from ext-soap for refs other than xml:lang. (#80, php-soap/wsdl-reader#66 and #67)ProvidesObjectEncoderLens or ProvidesObjectDecoderLens lens that throws now fails the encode or decode with an EncodingException, where it used to read as null. Custom object lenses have to handle their own misses, for example with reflecta's optional() or optional_property(). (#84)Feature\NullValueAware interface and the NullValueHandling enum. (#83)xsd:anyType, apache Map and SOAP-ENC Struct slots now decode by their xsi:type to the object, array or scalar they describe. Nil Map values and Struct members decode to null instead of "". (#76)Measured on 3MB payloads against 0.35.0, with the same machine, the same benchmarks and byte-identical output:
| workload | 0.35.0 | 0.36.0 | change |
|---|---|---|---|
| decode sparse (stdClass) | 7.152 s | 0.379 s | -94.7% |
| decode sparse (classmap) | 4.655 s | 0.797 s | -82.9% |
| decode dense (stdClass) | 0.833 s | 0.189 s | -77.3% |
| decode dense (classmap) | 0.517 s | 0.252 s | -51.4% |
| encode sparse (stdClass) | 2.920 s | 0.770 s | -73.6% |
| encode sparse (classmap) | 2.895 s | 0.909 s | -68.6% |
| encode dense (stdClass) | 0.935 s | 0.517 s | -44.7% |
| encode dense (classmap) | 0.920 s | 0.526 s | -42.8% |
The smaller phpbench payloads gain 25% to 75%. (#73, #74, #75, #78, #81, #82, #83, #84, #85, #86)
^1.2^4.14~0.34examples/calc-xsd-encoder.php runs again on the new Dom API. (#87)@ITernovtsii found why a 3MB response took 6 seconds to decode: an exception was thrown and caught for every absent element and every stdClass property. Their #70 showed the problem and the fix, and it started the throwless work in #73 to #75 and most of the speed gains in this release.
@NickSdot found that absent optional properties were sent as xsi:nil (#71) and that attributes and child elements with the same name got mixed up on decode (#72). Both fixes are in this release as #79 and #80, built on top of the throwless lenses, and they confirmed both against their own test suite.
Full Changelog: https://github.com/php-soap/encoding/compare/0.35.0...0.36.0
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Allow the full php-soap/wsdl-reader 0.x range by @veewee in https://github.com/php-soap/encoding/pull/69
Full Changelog: https://github.com/php-soap/encoding/compare/0.34.0...0.35.0
Migrate to STAB optics (Iso / Lens ) by @veewee in https://github.com/php-soap/encoding/pull/64
[!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: https://github.com/php-soap/encoding/compare/0.33.0...0.34.0
Warning
Custom encoders need updating. Reflecta's optics moved from 2 type parameters to 4, the STAB form: Iso<S, T, A, B> and Lens<S, T, A, B>. If you wrote your own XmlEncoder, SoapMethodEncoder, or anything implementing the Provides*Lens or DecoratingEncoder features, widen your generic annotations from 2 to 4 parameters.
S and A keep their old meaning (the whole, and the focus). T and B are 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
GH-59: Fix ObjectEncoder dropping attributes with falsy values by @ademarco in https://github.com/php-soap/encoding/pull/60
Full Changelog: https://github.com/php-soap/encoding/compare/0.32.0...0.33.0
Deprecated Document::configure(loader(...)) replaced with Document::fromLoader()
This release migrates the package to PHP 8.4's spec-compliant DOM API via veewee/xml ^4.10.
veewee/xml ^4.10php-standard-library/php-standard-library)Element::fromDOMElement() and Element::element() now accept/return Dom\Element instead of DOMElementXsiTypeDetector::detectXsdTypeFromXmlElement() and detectEncoderFromXmlElement() accept Dom\Element instead of DOMElementElementValueReader methods accept Dom\Element instead of DOMElement| 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 |
DOMDocument, DOMElement, DOMNode, DOMAttr type hints replaced with Dom\ namespace equivalentsDocument::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)psalm.xml for static analysis supportEncoding (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.
Full Changelog: https://github.com/php-soap/encoding/compare/0.31.0...0.32.0
Backport: Fix ObjectEncoder dropping attributes with falsy values by @veewee in https://github.com/php-soap/encoding/pull/62
Full Changelog: https://github.com/php-soap/encoding/compare/0.31.0...0.31.1
This release focuses entirely on encoding/decoding performance. No breaking changes.
This release focuses entirely on encoding/decoding performance. No breaking changes.
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.
| PR | Change |
|---|---|
| #52 | Cache inner Iso in XsiTypeEncoder to avoid redundant iso() calls |
| #53 | Cache type Iso in ElementEncoder; refactor ElementValueBuilder and ElementValueReader |
| #55 | Cache type Iso in AttributeValueEncoder |
| #56 | Cache FixedIsoEncoder per xsi:type in XsiTypeDetector; introduce ScopedCache; refactor EncoderDetector |
| #57 | Cache ObjectAccess::forContext() by type+namespace+bindingUse (largest single win) |
Bumping veewee/reflecta to ^0.17 also contributes a small improvement via a properties_set clone-once optimization (reflecta#26).
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).
| 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% |
| 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% |
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/encoding operates at the PHP level and provides full type-safety and WSDL-driven encoding as a pure PHP implementation.
veewee/reflecta version bumped to ^0.17.ScopedCache class (Soap\Encoding\Cache\ScopedCache) is @internal.Full Changelog: https://github.com/php-soap/encoding/compare/0.30.0...0.31.0
Fix duplicate xmlns attributes on qualified elements with xsi:type by @veewee in https://github.com/php-soap/encoding/pull/50
Full Changelog: https://github.com/php-soap/encoding/compare/0.29.0...0.30.0
Fix xsi:type namespace resolution for server-side prefixes by @veewee in https://github.com/php-soap/encoding/pull/49
Full Changelog: https://github.com/php-soap/encoding/compare/0.28.0...0.29.0
Full Changelog: 0.28.0...0.29.0
Replace azjezz/psl with php-standard-library/php-standard-library by @veewee in https://github.com/php-soap/encoding/pull/45
Full Changelog: https://github.com/php-soap/encoding/compare/0.27.0...0.28.0
feat: Update azjezz/psl requirement to include version 5.0 by @EJTJ3 in https://github.com/php-soap/encoding/pull/44
Full Changelog: https://github.com/php-soap/encoding/compare/0.26.0...0.27.0
Allow configuration of libxml options for decoding XML by @veewee in https://github.com/php-soap/encoding/pull/43
Full Changelog: https://github.com/php-soap/encoding/compare/0.25.0...0.26.0
Skip xsi:type generation for anonymous complex types. by @veewee in https://github.com/php-soap/encoding/pull/42
Full Changelog: https://github.com/php-soap/encoding/compare/0.24.0...0.25.0
Allow xsi:type information for use=literal polymorphism by @veewee in https://github.com/php-soap/encoding/pull/41
Full Changelog: https://github.com/php-soap/encoding/compare/0.23.0...0.24.0
Upgrade project to PHP 8.5 by @veewee in https://github.com/php-soap/encoding/pull/40
Full Changelog: https://github.com/php-soap/encoding/compare/0.22.0...0.23.0
Respect xsi:type information better by @veewee in https://github.com/php-soap/encoding/pull/39
Full Changelog: https://github.com/php-soap/encoding/compare/0.21.0...0.22.0
Improve parsing of ComplexTypeSimpleContent according to XSD rules. by @veewee in https://github.com/php-soap/encoding/pull/38
Full Changelog: https://github.com/php-soap/encoding/compare/0.20.0...0.21.0
Rework SOAP:Array encoder to support complex type items. by @veewee in https://github.com/php-soap/encoding/pull/37
Full Changelog: https://github.com/php-soap/encoding/compare/0.19.0...0.20.0
Fix reading RPC responses by @veewee in https://github.com/php-soap/encoding/pull/36
Full Changelog: https://github.com/php-soap/encoding/compare/0.18.0...0.19.0
Load object access information lazily by @veewee in https://github.com/php-soap/encoding/pull/35
Full Changelog: https://github.com/php-soap/encoding/compare/0.17.0...0.18.0
Detect nillable lists by @veewee in https://github.com/php-soap/encoding/pull/33
Full Changelog: https://github.com/php-soap/encoding/compare/0.16.0...0.17.0
Introduce message encoders for building soap servers by @veewee in https://github.com/php-soap/encoding/pull/32
Full Changelog: https://github.com/php-soap/encoding/compare/0.15.1...0.16.0
Fix: Backed-enum simpletypes should not be wrapped by element encoders by @veewee in https://github.com/php-soap/encoding/pull/31
Full Changelog: https://github.com/php-soap/encoding/compare/0.15.0...0.15.1
Introduce backed-enum classmaps by @veewee in https://github.com/php-soap/encoding/pull/30
Full Changelog: https://github.com/php-soap/encoding/compare/0.14.0...0.15.0
Add support for by @veewee in https://github.com/php-soap/encoding/pull/29
<any /> by @veewee in https://github.com/php-soap/encoding/pull/29Full Changelog: https://github.com/php-soap/encoding/compare/0.13.0...0.14.0
Bump dependencies by @veewee in https://github.com/php-soap/encoding/pull/28
Full Changelog: https://github.com/php-soap/encoding/compare/0.12.0...0.13.0
Introduce element aware encoders by @veewee in https://github.com/php-soap/encoding/pull/27
Full Changelog: https://github.com/php-soap/encoding/compare/0.11.0...0.12.0
Allow not setting optional objects and arrays whilst encoding. by @veewee in https://github.com/php-soap/encoding/pull/24
Full Changelog: https://github.com/php-soap/encoding/compare/0.10.0...0.11.0
Introduce a XsiTypeCalculator feature that can enhance xsi:type calculation from the encoder by @veewee in https://github.com/php-soap/encoding/pull/2
Full Changelog: https://github.com/php-soap/encoding/compare/0.9.1...0.10.0
Improved element xsi:type includeTargetNamespace logic by @veewee in https://github.com/php-soap/encoding/pull/20
Full Changelog: https://github.com/php-soap/encoding/compare/0.9.0...0.9.1
Allow child encoders to enhance the context for the element encoder. by @veewee in https://github.com/php-soap/encoding/pull/19
Full Changelog: https://github.com/php-soap/encoding/compare/0.8.0...0.9.0
Accept nillable values in object encoder by @veewee in https://github.com/php-soap/encoding/pull/18
Full Changelog: https://github.com/php-soap/encoding/compare/0.7.0...0.8.0
Improve operation and param element generation by @veewee in https://github.com/php-soap/encoding/pull/16
Full Changelog: https://github.com/php-soap/encoding/compare/0.6.0...0.7.0
PERF: Cache encoder detection by @veewee in https://github.com/php-soap/encoding/pull/11
- ^ "encoding took: 0.0050301551818848 seconds"
- ^ "HTTP took: 2.0833768844604 seconds"
- ^ "decoding took: 0.40147495269775 seconds"
- ^ "total took: 2.4872579574585 seconds"
- ^ "Response size: 119.1513671875 KB"
+ ^ "encoding took: 0.0039551258087158 seconds"
+ ^ "HTTP took: 2.2553861141205 seconds"
+ ^ "decoding took: 0.042151927947998 seconds"
+ ^ "total took: 2.3016350269318 seconds"
+ ^ "Response size: 119.1513671875 KB"
(Compared against v4 of this encoding package with lowest dependencies)
Reference : PHP's ext-soap
^ "encoding took: 0.0003361701965332 seconds"
^ "HTTP took: 2.2261168956757 seconds"
^ "decoding took: 0.011924028396606 seconds"
^ "total took: 2.2383770942688 seconds"
^ "Response size: 119.1513671875 KB"
Full Changelog: https://github.com/php-soap/encoding/compare/0.5.0...0.6.0
PERF: Add native function invocations by @veewee in https://github.com/php-soap/encoding/pull/8
Full Changelog: https://github.com/php-soap/encoding/compare/0.4.1...0.5.0
Broaden reflecta deps by @veewee in https://github.com/php-soap/encoding/pull/7
Full Changelog: https://github.com/php-soap/encoding/compare/0.4.0...0.4.1
Normalize property names to supported php names in the object encoder by @veewee in https://github.com/php-soap/encoding/pull/6
Full Changelog: https://github.com/php-soap/encoding/compare/0.3.0...0.4.0
Improve deps list by @veewee in https://github.com/php-soap/encoding/pull/5
Full Changelog: https://github.com/php-soap/encoding/compare/0.2.0...0.3.0
Introduce a class-map concept (similar to ext-soap-engine) by @veewee in https://github.com/php-soap/encoding/pull/4
Full Changelog: https://github.com/php-soap/encoding/compare/0.1.0...0.2.0
Full Changelog: https://github.com/php-soap/encoder/commits/0.1.0
Full Changelog: https://github.com/php-soap/encoder/commits/0.1.0
One column per month.