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