xref: /PHP-8.3/ext/soap/tests/bug77088.phpt (revision 7f2f0c00)
1--TEST--
2Bug #77088 (Segfault when using SoapClient with null options)
3--EXTENSIONS--
4soap
5--FILE--
6<?php
7
8try
9{
10    $options = NULL;
11    $sClient = new SoapClient("test.wsdl", $options);
12}
13catch(TypeError $e)
14{
15    var_dump($e);
16}
17
18?>
19--EXPECTF--
20object(TypeError)#%d (%d) {
21  ["message":protected]=>
22  string(%d) "SoapClient::__construct(): Argument #2 ($options) must be of type array, null given"
23  ["string":"Error":private]=>
24  string(0) ""
25  ["code":protected]=>
26  int(0)
27  ["file":protected]=>
28  string(%d) "%sbug77088.php"
29  ["line":protected]=>
30  int(6)
31  ["trace":"Error":private]=>
32  array(1) {
33    [0]=>
34    array(6) {
35      ["file"]=>
36      string(%d) "%sbug77088.php"
37      ["line"]=>
38      int(6)
39      ["function"]=>
40      string(11) "__construct"
41      ["class"]=>
42      string(10) "SoapClient"
43      ["type"]=>
44      string(2) "->"
45      ["args"]=>
46      array(2) {
47        [0]=>
48        string(9) "test.wsdl"
49        [1]=>
50        NULL
51      }
52    }
53  }
54  ["previous":"Error":private]=>
55  NULL
56}
57