Category
stdlib · php-src-strict · child of #3724
Problem
SoapVar arguments to SoapClient::__soapCall() are exported as enc_* property bags and then encoded as a nested struct. Zend master_to_xml_int() unwraps enc_value and applies get_conversion(enc_type) (php-src ext/soap/php_encoding.c).
| Repro |
Zend 8.2+ (php_encoding.c) |
VM (2026-08-18) |
new SoapVar(123, XSD_STRING) |
<param0 xsi:type="xsd:string">123</param0> |
<param0><enc_type xsi:type="xsd:int">101</enc_type><enc_value …>123</enc_value>…</param0> |
Reflection probe of VmSoapClient::encodeParam on the exported bag:
<param0><enc_type xsi:type="xsd:int">101</enc_type><enc_value xsi:type="xsd:int">123</enc_value><enc_stype xsi:nil="true"/>…</param0>
soapVarShape() currently requires enc_stype, so new SoapVar($v, XSD_STRING) (no typeName) is not recognized as a SoapVar.
php-src reference
PHP implementation target
Repro
./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/issue_soapvar_xsd_enc_type.php'
# host php-soap required to advertise SoapClient; unit test covers encodeParam without it
Done when
Category
stdlib· php-src-strict · child of #3724Problem
SoapVararguments toSoapClient::__soapCall()are exported asenc_*property bags and then encoded as a nested struct. Zendmaster_to_xml_int()unwrapsenc_valueand appliesget_conversion(enc_type)(php-srcext/soap/php_encoding.c).new SoapVar(123, XSD_STRING)<param0 xsi:type="xsd:string">123</param0><param0><enc_type xsi:type="xsd:int">101</enc_type><enc_value …>123</enc_value>…</param0>Reflection probe of
VmSoapClient::encodeParamon the exported bag:soapVarShape()currently requiresenc_stype, sonew SoapVar($v, XSD_STRING)(no typeName) is not recognized as a SoapVar.php-src reference
ext/soap/php_encoding.c—master_to_xml_int()SoapVar branch:get_conversion(Z_LVAL_P(ztype))thenmaster_to_xml(enc, Z_VAR_ENC_VALUE_P(data), …)ext/soap/php_encoding.h—XSD_STRING101 →"string"/XSD_NAMESPACEPHP implementation target
ext/soap/VmSoapClient.php—encodeParam()/soapVarShape()unwrapenc_valueand emitxsi:typefromenc_typefor scalar XSD_* idsto_xmlpath whenenc_stypematches a typemap entry (Stdlib: SoapClient typemap from_xml/to_xml callbacks missing (ext/soap/php_encoding.c) #21046)Repro
Done when
SoapVar(123, XSD_STRING)encoded request containsxsi:type="xsd:string"and text123(noenc_type/enc_valuechild elements)XSD_STRING,XSD_INT,XSD_BOOLEAN,XSD_FLOAT,XSD_BASE64BINARY,XSD_HEXBINARY) match Zendto_xml_*.phptundertest/compliance/cases/stdlib/