Re: Accept null type hint in C
| From: | Marcus Boerger | Date: | Thu, 27 Oct 2005 07:05:46 +0000 |
| Subject: | Re: Accept null type hint in C | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-19754@lists.php.net to get a copy of this message | ||
Hello Bob,
Thursday, October 27, 2005, 8:51:18 AM, you wrote:
> Hi,
> Since NULL typehints are allowed in userland, how would I go about it in C?
> I have ZEND_ARG_OBJ_INFO(0, obj, ZObject, 1) which has allow null set on.
> Then in the method:
> if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &objA,
> pow_ce_ZObject) == FAILURE) {
Use "|!O" or "|!o" instead. '!' allows NULL and sets the return value
in
c-land to NULL.
marcus
> If I pass NULL, it fails on the grounds that it isn't a ZObject.
> Also,
> Could someone explain the purpose of the zend_parse_method_parameters
> function as opposed to using the zend_parse_parameters?
> Thanks
> Bob Silva
Best regards,
Marcus