1--TEST--
2SoapServer constructor with an invalid encoding option
3--EXTENSIONS--
4soap
5--FILE--
6<?php
7
8class ExtendedSoapServer extends SoapServer {}
9
10$wsdl = 'irrelevant';
11$options = [
12    'soap_version' => 1111,
13];
14try {
15    $client = new SoapServer($wsdl, $options);
16} catch (Throwable $e) {
17    echo $e::class, ': ', $e->getMessage(), PHP_EOL;
18}
19try {
20    $client = new ExtendedSoapServer($wsdl, $options);
21} catch (Throwable $e) {
22    echo $e::class, ': ', $e->getMessage(), PHP_EOL;
23}
24
25
26?>
27--EXPECT--
28<?xml version="1.0" encoding="UTF-8"?>
29<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>SoapServer::__construct(): 'soap_version' option must be SOAP_1_1 or SOAP_1_2</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
30