1--TEST--
2Segfault and assertion failure with refcounted props and arrays
3--INI--
4soap.wsdl_cache_enabled=0
5--EXTENSIONS--
6soap
7--FILE--
8<?php
9class TestSoapClient extends SoapClient {
10  function __doRequest($request, $location, $action, $version, $one_way = false): ?string {
11        return <<<EOF
12<?xml version="1.0" encoding="UTF-8"?>
13<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://schemas.nothing.com" 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>
14<ns1:dotest2Response><res xsi:type="SOAP-ENC:Struct">
15    <a xsi:type="xsd:string">Hello</a>
16    <b xsi:type="xsd:string">World</b>
17</res>
18</ns1:dotest2Response></SOAP-ENV:Body></SOAP-ENV:Envelope>
19EOF;
20    }
21}
22
23trait A {
24    public $a = [self::class . 'a'];
25    public $b = self::class . 'b';
26}
27
28class DummyClass {
29    use A;
30}
31
32$client = new TestSoapClient(__DIR__."/../classmap.wsdl", ['classmap' => ['Struct' => 'DummyClass']]);
33var_dump($client->dotest2("???"));
34?>
35--EXPECT--
36object(DummyClass)#2 (2) {
37  ["a"]=>
38  array(2) {
39    [0]=>
40    string(11) "DummyClassa"
41    [1]=>
42    string(5) "Hello"
43  }
44  ["b"]=>
45  array(2) {
46    [0]=>
47    string(11) "DummyClassb"
48    [1]=>
49    string(5) "World"
50  }
51}
52