xref: /PHP-8.1/ext/soap/tests/bugs/bug77141.phpt (revision f4865010)
1--TEST--
2Bug #77141 (Signedness issue in SOAP when precision=-1)
3--EXTENSIONS--
4soap
5--FILE--
6<?php
7class MySoapClient extends SoapClient {
8    public function __doRequest($request, $location, $action, $version, $one_way = 0): string {
9        echo $request, "\n";
10        return '';
11    }
12}
13
14$soap = new MySoapClient(
15    null,
16    array(
17        'location' => "http://localhost/soap.php",
18        'uri' => "http://localhost/",
19        'style' => SOAP_RPC,
20        'trace' => true,
21        'exceptions' => false,
22    )
23);
24ini_set('precision', -1);
25$soap->call(1.1);
26?>
27--EXPECT--
28<?xml version="1.0" encoding="UTF-8"?>
29<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://localhost/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:call><param0 xsi:type="xsd:float">1.1</param0></ns1:call></SOAP-ENV:Body></SOAP-ENV:Envelope>
30