Skip to content

Commit 5b88de0

Browse files
committed
properly handle lexical scope
1 parent a07890e commit 5b88de0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Zend/zend_object_handlers.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1837,7 +1837,7 @@ ZEND_API zend_function *zend_std_get_method(zend_object **obj_ptr, zend_string *
18371837
if (zobj->ce->__call) {
18381838
fbc = zend_get_user_call_function(zobj->ce, method_name);
18391839
} else {
1840-
if (scope->lexical_scope) {
1840+
if (scope && scope->lexical_scope) {
18411841
scope = scope->lexical_scope;
18421842
goto check_lexical_scope;
18431843
}
@@ -1906,7 +1906,7 @@ ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, zend_st
19061906
|| UNEXPECTED(!zend_check_protected(zend_get_function_root_class(fbc), scope))) {
19071907
zend_function *fallback_fbc = get_static_method_fallback(ce, function_name);
19081908
if (!fallback_fbc) {
1909-
if (scope->lexical_scope) {
1909+
if (scope && scope->lexical_scope) {
19101910
scope = scope->lexical_scope;
19111911
goto check_lexical_scope;
19121912
}

0 commit comments

Comments
 (0)