Skip to content

Commit 53ec276

Browse files
committed
add type check to return type
1 parent 2c2b277 commit 53ec276

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Zend/zend_vm_def.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4526,7 +4526,7 @@ ZEND_VM_COLD_CONST_HANDLER(124, ZEND_VERIFY_RETURN_TYPE, CONST|TMP|VAR|UNUSED|CV
45264526

45274527
SAVE_OPLINE();
45284528

4529-
if (Z_OBJCE_P(retval_ptr)->required_scope) {
4529+
if (Z_TYPE_P(retval_ptr) == IS_OBJECT && Z_OBJCE_P(retval_ptr)->required_scope) {
45304530
if (EX(func)->common.fn_flags & ZEND_ACC_PUBLIC) {
45314531
if (Z_OBJCE_P(retval_ptr)->required_scope_absolute) {
45324532
zend_type_error("Public method %s cannot return private class %s", ZSTR_VAL(EX(func)->common.function_name), ZSTR_VAL(Z_OBJCE_P(retval_ptr)->name));

0 commit comments

Comments
 (0)