Skip to content

Commit 6efec1b

Browse files
committed
Fix tests and rename variable
1 parent 09be412 commit 6efec1b

File tree

5 files changed

+65
-80
lines changed

5 files changed

+65
-80
lines changed

Zend/tests/attributes_001.phpt

Lines changed: 57 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -70,68 +70,106 @@ array(0) {
7070
}
7171
array(1) {
7272
["TestFunction"]=>
73-
array(0) {
73+
array(1) {
74+
[0]=>
75+
array(0) {
76+
}
7477
}
7578
}
7679
array(1) {
7780
["TestClass"]=>
78-
array(0) {
81+
array(1) {
82+
[0]=>
83+
array(0) {
84+
}
7985
}
8086
}
8187
array(1) {
8288
["TestConst"]=>
83-
array(0) {
89+
array(1) {
90+
[0]=>
91+
array(0) {
92+
}
8493
}
8594
}
8695
array(1) {
8796
["TestProp"]=>
88-
array(0) {
97+
array(1) {
98+
[0]=>
99+
array(0) {
100+
}
89101
}
90102
}
91103
array(3) {
92104
["a1"]=>
93-
array(0) {
105+
array(1) {
106+
[0]=>
107+
array(0) {
108+
}
94109
}
95110
["a2"]=>
96111
array(1) {
97112
[0]=>
98-
int(1)
113+
array(1) {
114+
[0]=>
115+
int(1)
116+
}
99117
}
100118
["a3"]=>
101-
array(2) {
119+
array(1) {
102120
[0]=>
103-
int(1)
104-
[1]=>
105-
int(2)
121+
array(2) {
122+
[0]=>
123+
int(1)
124+
[1]=>
125+
int(2)
126+
}
106127
}
107128
}
108129
array(4) {
109130
["a1"]=>
110-
array(0) {
131+
array(1) {
132+
[0]=>
133+
array(0) {
134+
}
111135
}
112136
["a2"]=>
113137
array(1) {
114138
[0]=>
115-
int(2)
139+
array(1) {
140+
[0]=>
141+
int(2)
142+
}
116143
}
117144
["a3"]=>
118145
array(1) {
119146
[0]=>
120-
int(4)
147+
array(2) {
148+
[0]=>
149+
int(4)
150+
[1]=>
151+
int(4)
152+
}
121153
}
122154
["a4"]=>
123155
array(1) {
124156
[0]=>
125-
array(2) {
126-
["a"]=>
127-
int(1)
128-
["b"]=>
129-
int(2)
157+
array(1) {
158+
[0]=>
159+
array(2) {
160+
["a"]=>
161+
int(1)
162+
["b"]=>
163+
int(2)
164+
}
130165
}
131166
}
132167
}
133168
array(1) {
134169
["Foo\Bar"]=>
135-
array(0) {
170+
array(1) {
171+
[0]=>
172+
array(0) {
173+
}
136174
}
137175
}

Zend/tests/attributes_004.phpt

Lines changed: 0 additions & 10 deletions
This file was deleted.

Zend/tests/attributes_005.phpt

Lines changed: 0 additions & 12 deletions
This file was deleted.

Zend/tests/attributes_007.phpt

Lines changed: 0 additions & 31 deletions
This file was deleted.

ext/reflection/php_reflection.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,11 +1055,11 @@ static void reflection_attribute_factory(zval *object, zend_string *name, zval *
10551055
}
10561056
/* }}} */
10571057

1058-
static int convert_ast_to_zval(zval *ret, zend_ast *ast, zend_class_entry *ce)
1058+
static int convert_ast_to_zval(zval *ret, zend_ast *ast, zend_class_entry *scope_ce)
10591059
{
10601060
if (ast->kind == ZEND_AST_CONSTANT) {
10611061
zend_string *name = zend_ast_get_constant_name(ast);
1062-
zval *zv = zend_get_constant_ex(name, ce, ast->attr);
1062+
zval *zv = zend_get_constant_ex(name, scope_ce, ast->attr);
10631063

10641064
if (UNEXPECTED(zv == NULL)) {
10651065
return FAILURE;
@@ -1069,7 +1069,7 @@ static int convert_ast_to_zval(zval *ret, zend_ast *ast, zend_class_entry *ce)
10691069
} else {
10701070
zval tmp;
10711071

1072-
if (UNEXPECTED(zend_ast_evaluate(&tmp, ast, ce) != SUCCESS)) {
1072+
if (UNEXPECTED(zend_ast_evaluate(&tmp, ast, scope_ce) != SUCCESS)) {
10731073
return FAILURE;
10741074
}
10751075

@@ -1080,7 +1080,7 @@ static int convert_ast_to_zval(zval *ret, zend_ast *ast, zend_class_entry *ce)
10801080
return SUCCESS;
10811081
}
10821082

1083-
static int convert_ast_attributes(zval *ret, HashTable *attributes, zend_class_entry *ce)
1083+
static int convert_ast_attributes(zval *ret, HashTable *attributes, zend_class_entry *scope_ce)
10841084
{
10851085
Bucket *p;
10861086
zval tmp;
@@ -1093,7 +1093,7 @@ static int convert_ast_attributes(zval *ret, HashTable *attributes, zend_class_e
10931093
}
10941094

10951095
if (Z_TYPE(p->val) == IS_CONSTANT_AST) {
1096-
if (FAILURE == convert_ast_to_zval(&tmp, Z_ASTVAL(p->val), ce)) {
1096+
if (FAILURE == convert_ast_to_zval(&tmp, Z_ASTVAL(p->val), scope_ce)) {
10971097
return FAILURE;
10981098
}
10991099

@@ -1107,7 +1107,7 @@ static int convert_ast_attributes(zval *ret, HashTable *attributes, zend_class_e
11071107
return SUCCESS;
11081108
}
11091109

1110-
static int convert_attributes(zval *ret, HashTable *attributes, zend_class_entry *ce)
1110+
static int convert_attributes(zval *ret, HashTable *attributes, zend_class_entry *scope_ce)
11111111
{
11121112
Bucket *p;
11131113
zval *v;
@@ -1128,7 +1128,7 @@ static int convert_attributes(zval *ret, HashTable *attributes, zend_class_entry
11281128
v = zend_hash_index_find(Z_ARRVAL(p->val), 0);
11291129

11301130
if (Z_TYPE_P(v) == IS_STRING) {
1131-
if (FAILURE == convert_ast_attributes(&result, Z_ARRVAL(p->val), ce)) {
1131+
if (FAILURE == convert_ast_attributes(&result, Z_ARRVAL(p->val), scope_ce)) {
11321132
zval_ptr_dtor(ret);
11331133
return FAILURE;
11341134
}
@@ -1144,7 +1144,7 @@ static int convert_attributes(zval *ret, HashTable *attributes, zend_class_entry
11441144
ZEND_HASH_FOREACH_VAL(Z_ARRVAL(p->val), zv) {
11451145
ZEND_ASSERT(Z_TYPE_P(zv) == IS_ARRAY);
11461146

1147-
if (FAILURE == convert_ast_attributes(&result, Z_ARRVAL_P(zv), ce)) {
1147+
if (FAILURE == convert_ast_attributes(&result, Z_ARRVAL_P(zv), scope_ce)) {
11481148
zval_ptr_dtor(ret);
11491149
return FAILURE;
11501150
}

0 commit comments

Comments
 (0)