We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d69d623 commit f3435f9Copy full SHA for f3435f9
Zend/zend_execute_API.c
@@ -1134,8 +1134,10 @@ ZEND_API zend_result zend_call_method_if_exists(
1134
zend_function *fn = zend_hash_find_ptr_lc(&ce->function_table, method_name);
1135
bool is_trampoline = false;
1136
1137
- if (UNEXPECTED(fn == NULL)) {
1138
- /* We don't have a trampoline */
+ /* Can only call methods that exist (regardless of them being static) and are public */
+ if (UNEXPECTED(fn == NULL || (fn->common.fn_flags & ZEND_ACC_PUBLIC) == 0)) {
1139
+ /* Unless they have a trampoline (but not a static one) which we can use */
1140
+ // TODO: Should static trampolines be allowed?
1141
if (!ce->__call) {
1142
ZVAL_UNDEF(retval);
1143
return FAILURE;
0 commit comments