xref: /PHP-8.3/Zend/tests/bug46238.phpt (revision e6810698)
1--TEST--
2Bug #46238 (Segmentation fault on static call with empty string method)
3--FILE--
4<?php
5
6class a {
7        static function __callStatic($name, $arguments)
8        {
9                var_dump(array($name, $arguments));
10        }
11}
12
13$a = 'a';
14$b = '';
15
16$a::$b($a);
17$a::$b(array());
18$a::$b(NULL);
19$a::$b(1);
20$a::$b();
21
22
23$b = "\0";
24
25$a::$b($a);
26$a::$b(array());
27$a::$b(NULL);
28$a::$b(1);
29$a::$b();
30
31?>
32--EXPECT--
33array(2) {
34  [0]=>
35  string(0) ""
36  [1]=>
37  array(1) {
38    [0]=>
39    string(1) "a"
40  }
41}
42array(2) {
43  [0]=>
44  string(0) ""
45  [1]=>
46  array(1) {
47    [0]=>
48    array(0) {
49    }
50  }
51}
52array(2) {
53  [0]=>
54  string(0) ""
55  [1]=>
56  array(1) {
57    [0]=>
58    NULL
59  }
60}
61array(2) {
62  [0]=>
63  string(0) ""
64  [1]=>
65  array(1) {
66    [0]=>
67    int(1)
68  }
69}
70array(2) {
71  [0]=>
72  string(0) ""
73  [1]=>
74  array(0) {
75  }
76}
77array(2) {
78  [0]=>
79  string(0) ""
80  [1]=>
81  array(1) {
82    [0]=>
83    string(1) "a"
84  }
85}
86array(2) {
87  [0]=>
88  string(0) ""
89  [1]=>
90  array(1) {
91    [0]=>
92    array(0) {
93    }
94  }
95}
96array(2) {
97  [0]=>
98  string(0) ""
99  [1]=>
100  array(1) {
101    [0]=>
102    NULL
103  }
104}
105array(2) {
106  [0]=>
107  string(0) ""
108  [1]=>
109  array(1) {
110    [0]=>
111    int(1)
112  }
113}
114array(2) {
115  [0]=>
116  string(0) ""
117  [1]=>
118  array(0) {
119  }
120}
121