Skip to content

Commit d8a0d9a

Browse files
committed
Fix another bunch of tests
1 parent e4ed2f4 commit d8a0d9a

8 files changed

+15
-6
lines changed

Zend/zend_closures.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,7 @@ ZEND_API zend_function *zend_get_closure_invoke_method(zend_object *object) /* {
480480
ZEND_ACC_USER_ARG_INFO;
481481
}
482482
invoke->internal_function.handler = ZEND_MN(Closure___invoke);
483+
invoke->internal_function.doc_comment = NULL;
483484
invoke->internal_function.module = 0;
484485
invoke->internal_function.scope = zend_ce_closure;
485486
invoke->internal_function.function_name = ZSTR_KNOWN(ZEND_STR_MAGIC_INVOKE);
@@ -865,6 +866,7 @@ void zend_closure_from_frame(zval *return_value, zend_execute_data *call) { /* {
865866
trampoline.handler = zend_closure_call_magic;
866867
trampoline.function_name = mptr->common.function_name;
867868
trampoline.scope = mptr->common.scope;
869+
trampoline.doc_comment = NULL;
868870
if (trampoline.fn_flags & ZEND_ACC_VARIADIC) {
869871
trampoline.arg_info = trampoline_arg_info;
870872
}

Zend/zend_compile.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,8 +525,8 @@ typedef struct _zend_internal_function {
525525
uint32_t T; /* number of temporary variables */
526526
/* END of common elements */
527527

528-
zend_string *doc_comment;
529528
zif_handler handler;
529+
zend_string *doc_comment;
530530
struct _zend_module_entry *module;
531531
const zend_frameless_function_info *frameless_function_infos;
532532
void *reserved[ZEND_MAX_RESERVED_RESOURCES];

Zend/zend_execute.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ ZEND_API const zend_internal_function zend_pass_function = {
150150
NULL, /* attributes */
151151
NULL, /* run_time_cache */
152152
0, /* T */
153-
NULL, /* doc_comment */
154153
ZEND_FN(pass), /* handler */
154+
NULL, /* doc_comment */
155155
NULL, /* module */
156156
NULL, /* frameless_function_infos */
157157
{NULL,NULL,NULL,NULL} /* reserved */

ext/com_dotnet/com_handlers.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,7 @@ static zend_function *com_method_get(zend_object **object_ptr, zend_string *name
311311
f.fn_flags = ZEND_ACC_CALL_VIA_HANDLER;
312312
f.function_name = zend_string_copy(name);
313313
f.handler = PHP_FN(com_method_handler);
314+
f.doc_comment = NULL;
314315

315316
fptr = &f;
316317

ext/pdo/pdo_dbh.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1336,6 +1336,7 @@ bool pdo_hash_methods(pdo_dbh_object_t *dbh_obj, int kind)
13361336
} else {
13371337
func.fn_flags = ZEND_ACC_PUBLIC | ZEND_ACC_NEVER_CACHE;
13381338
}
1339+
func.doc_comment = NULL;
13391340
if (funcs->arg_info) {
13401341
zend_internal_function_info *info = (zend_internal_function_info*)funcs->arg_info;
13411342

ext/reflection/php_reflection.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -895,7 +895,7 @@ static zval *property_get_default(zend_property_info *prop_info) {
895895
/* {{{ _property_string */
896896
static void _property_string(smart_str *str, zend_property_info *prop, const char *prop_name, char* indent)
897897
{
898-
if (prop->doc_comment) {
898+
if (prop && prop->doc_comment) {
899899
smart_str_append_printf(str, "%s%s\n", indent, ZSTR_VAL(prop->doc_comment));
900900
}
901901
smart_str_append_printf(str, "%sProperty [ ", indent);
@@ -1929,7 +1929,9 @@ ZEND_METHOD(ReflectionFunctionAbstract, getDocComment)
19291929

19301930
if (fptr->type == ZEND_USER_FUNCTION && fptr->op_array.doc_comment) {
19311931
RETURN_STR_COPY(fptr->op_array.doc_comment);
1932-
} else if (fptr->type == ZEND_INTERNAL_FUNCTION && ((zend_internal_function *) fptr)->doc_comment) {
1932+
}
1933+
1934+
if (fptr->type == ZEND_INTERNAL_FUNCTION && ((zend_internal_function *) fptr)->doc_comment) {
19331935
RETURN_STR_COPY(((zend_internal_function *) fptr)->doc_comment);
19341936
}
19351937

ext/reflection/tests/ReflectionClassConstant_basic1.phpt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ reflectClassConstant($instance, "BAD_CONST");
5757
Reflecting on class constant TestClass::PUB
5858

5959
__toString():
60-
string(35) "Constant [ public bool PUB ] { 1 }
60+
string(57) "/** My Doc comment */
61+
Constant [ public bool PUB ] { 1 }
6162
"
6263
getName():
6364
string(3) "PUB"
@@ -89,7 +90,8 @@ bool
8990
Reflecting on class constant TestClass::PROT
9091

9192
__toString():
92-
string(38) "Constant [ protected int PROT ] { 4 }
93+
string(65) "/** Another doc comment */
94+
Constant [ protected int PROT ] { 4 }
9395
"
9496
getName():
9597
string(4) "PROT"

ext/reflection/tests/constructor_promotion.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ Class [ <user> class Test ] {
4646
- Properties [3] {
4747
Property [ public $z = NULL ]
4848
Property [ public int $x ]
49+
/** @SomeAnnotation() */
4950
Property [ public string $y ]
5051
}
5152

0 commit comments

Comments
 (0)