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

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to