@@ -225,6 +225,9 @@ zend_function *ClassImpl::getMethod(zend_object **object, zend_string *method, c
225225 auto *data = (CallData *)emalloc (sizeof (CallData));
226226 auto *function = &data->func ;
227227
228+ // reset everything to zero (in case future PHP versions add more fields)
229+ memset (function, 0 , sizeof (*function));
230+
228231 // set all properties
229232 function->type = ZEND_INTERNAL_FUNCTION;
230233 function->arg_flags [0 ] = 0 ;
@@ -269,6 +272,9 @@ zend_function *ClassImpl::getStaticMethod(zend_class_entry *entry, zend_string *
269272 auto *data = (CallData *)emalloc (sizeof (CallData));
270273 auto *function = &data->func ;
271274
275+ // reset everything to zero (in case future PHP versions add more fields)
276+ memset (function, 0 , sizeof (*function));
277+
272278 // set all properties for the function
273279 function->type = ZEND_INTERNAL_FUNCTION;
274280 function->arg_flags [0 ] = 0 ;
@@ -319,6 +325,9 @@ zend_result ClassImpl::getClosure(ZEND_OBJECT_OR_ZVAL object, zend_class_entry *
319325 auto *data = (CallData *)emalloc (sizeof (CallData));
320326 auto *function = &data->func ;
321327
328+ // reset everything to zero (in case future PHP versions add more fields)
329+ memset (function, 0 , sizeof (*function));
330+
322331 // we're going to set all properties of the zend_internal_function struct
323332 function->type = ZEND_INTERNAL_FUNCTION;
324333 function->arg_flags [0 ] = 0 ;
0 commit comments