Re: * New Parameter Parsing Functions *
| From: | Markus Fischer | Date: | Fri, 12 Oct 2001 09:13:47 +0000 |
| Subject: | Re: * New Parameter Parsing Functions * | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-67836@lists.php.net to get a copy of this message | ||
On Tue, Jul 10, 2001 at 10:35:04AM -0500, Andrei Zmievski wrote :
> Type specifiers
> ---------------
[...]
> r - resource (stored in zval)
[...]
> The following characters also have a meaning in the specifier string:
> | - indicates that the remaining parameters are optional, they
> should be initialized to default values by the extension since they
> will not be touched by the parsing function if they are not
> passed to it.
> / - use SEPARATE_ZVAL_IF_NOT_REF() on the parameter it follows
> ! - the parameter it follows can be of specified type or NULL (only applies
> to 'a', 'o', 'O', 'r', and 'z'). If
> NULL is passed, the results
> pointer is set to NULL as well.
When I try the following (long value with optional resource which
can be null also):
int arg_format;
zval *arg_sharelist = NULL;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|!r",
&arg_format, &arg_sharelist) == FAILURE) {
and I pass
myfunc(0, NULL);
I get
myfunc() expects argument 2 to be unknown, null given
Is the format string syntax wrong?
ty,
Markus