File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -209,7 +209,7 @@ impl ExecuteData {
209209 }
210210 }
211211
212- pub unsafe fn get_parameters_array ( & mut self ) -> Vec < ManuallyDrop < ZVal > > {
212+ pub ( crate ) unsafe fn get_parameters_array ( & mut self ) -> Vec < ManuallyDrop < ZVal > > {
213213 unsafe {
214214 let num_args = self . num_args ( ) ;
215215 let mut arguments = vec ! [ zeroed:: <zval>( ) ; num_args] ;
@@ -238,6 +238,18 @@ impl ExecuteData {
238238 ZVal :: from_mut_ptr ( val)
239239 }
240240 }
241+
242+ /// Ensure parameter slot exists, if not, create it and set to null.
243+ pub fn ensure_parameter_slot ( & mut self , index : usize ) {
244+ let num_args = self . num_args ( ) ;
245+ if index >= num_args {
246+ unsafe {
247+ let params_ptr = phper_zend_call_var_num ( self . as_mut_ptr ( ) , index as i32 ) ;
248+ phper_zval_null ( params_ptr) ;
249+ ( * self . inner . func ) . common . num_args = ( index + 1 ) as u32 ;
250+ }
251+ }
252+ }
241253}
242254
243255/// Wrapper of [zval].
You can’t perform that action at this time.
0 commit comments