Re: Warning about passing argumensts by reference
| From: | Sara Golemon | Date: | Mon, 24 Nov 2003 16:29:08 +0000 |
| Subject: | Re: Warning about passing argumensts by reference | ||
| References: | 1 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-228@lists.php.net to get a copy of this message | ||
> The problem is that odbtp_attach_field() is a PECL function and not a
> script declared function. What do I need to do in the C code declaration
> of this function to prevent this warning from occuring? Below is the code
> for this function.
>
Make a structure in the same file where your PHP_FE(odbtp_attach_field,
NULL) declaration is:
static
ZEND_BEGIN_ARG_INFO(third_arg_force_ref, 0)
ZEND_ARG_PASS_INFO(0)
ZEND_ARG_PASS_INFO(0)
ZEND_ARG_PASS_INFO(1)
ZEND_END_ARG_INFO()
Then change your FE declaration to:
PHP_FE(odbtp_attach_field, third_arg_force_ref)
Then in your script simply don't bother trying to pass your argument by
reference, the function handler will know how to deal with it.
-Sara