Skip to content

Commit a9dacc3

Browse files
committed
add type check to return type
1 parent 00d1510 commit a9dacc3

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
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));

Zend/zend_vm_execute.h

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

0 commit comments

Comments
 (0)