Skip to content

Commit c91f4b4

Browse files
committed
Use @virtual annotation in XMLReader
All properties of XMLReader are virtual and therefore don't need backing storage.
1 parent b341715 commit c91f4b4

4 files changed

+29
-71
lines changed

ext/xmlreader/php_xmlreader.stub.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,32 +99,46 @@ class XMLReader
9999
public const int SUBST_ENTITIES = UNKNOWN;
100100

101101

102+
/** @virtual */
102103
public int $attributeCount;
103104

105+
/** @virtual */
104106
public string $baseURI;
105107

108+
/** @virtual */
106109
public int $depth;
107110

111+
/** @virtual */
108112
public bool $hasAttributes;
109113

114+
/** @virtual */
110115
public bool $hasValue;
111116

117+
/** @virtual */
112118
public bool $isDefault;
113119

120+
/** @virtual */
114121
public bool $isEmptyElement;
115122

123+
/** @virtual */
116124
public string $localName;
117125

126+
/** @virtual */
118127
public string $name;
119128

129+
/** @virtual */
120130
public string $namespaceURI;
121131

132+
/** @virtual */
122133
public int $nodeType;
123134

135+
/** @virtual */
124136
public string $prefix;
125137

138+
/** @virtual */
126139
public string $value;
127140

141+
/** @virtual */
128142
public string $xmlLang;
129143

130144
/** @tentative-return-type */

ext/xmlreader/php_xmlreader_arginfo.h

Lines changed: 15 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ext/xmlreader/tests/fromStream_custom_constructor.phpt

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -27,34 +27,6 @@ fclose($h);
2727
--EXPECTF--
2828
hello world
2929
object(CustomXMLReader)#%d (1) {
30-
["attributeCount"]=>
31-
uninitialized(int)
32-
["baseURI"]=>
33-
uninitialized(string)
34-
["depth"]=>
35-
uninitialized(int)
36-
["hasAttributes"]=>
37-
uninitialized(bool)
38-
["hasValue"]=>
39-
uninitialized(bool)
40-
["isDefault"]=>
41-
uninitialized(bool)
42-
["isEmptyElement"]=>
43-
uninitialized(bool)
44-
["localName"]=>
45-
uninitialized(string)
46-
["name"]=>
47-
uninitialized(string)
48-
["namespaceURI"]=>
49-
uninitialized(string)
50-
["nodeType"]=>
51-
uninitialized(int)
52-
["prefix"]=>
53-
uninitialized(string)
54-
["value"]=>
55-
uninitialized(string)
56-
["xmlLang"]=>
57-
uninitialized(string)
5830
["myField"]=>
5931
int(1234)
6032
}

ext/xmlreader/tests/fromString_custom_constructor.phpt

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -21,34 +21,6 @@ var_dump($reader->nodeType);
2121
--EXPECTF--
2222
hello world
2323
object(CustomXMLReader)#%d (1) {
24-
["attributeCount"]=>
25-
uninitialized(int)
26-
["baseURI"]=>
27-
uninitialized(string)
28-
["depth"]=>
29-
uninitialized(int)
30-
["hasAttributes"]=>
31-
uninitialized(bool)
32-
["hasValue"]=>
33-
uninitialized(bool)
34-
["isDefault"]=>
35-
uninitialized(bool)
36-
["isEmptyElement"]=>
37-
uninitialized(bool)
38-
["localName"]=>
39-
uninitialized(string)
40-
["name"]=>
41-
uninitialized(string)
42-
["namespaceURI"]=>
43-
uninitialized(string)
44-
["nodeType"]=>
45-
uninitialized(int)
46-
["prefix"]=>
47-
uninitialized(string)
48-
["value"]=>
49-
uninitialized(string)
50-
["xmlLang"]=>
51-
uninitialized(string)
5224
["myField"]=>
5325
int(1234)
5426
}

0 commit comments

Comments
 (0)