Hello Bob, there is also an *_ex() version of the parsing function that can be made not emitting a warning on type missmatch. That way you can have a first one look for the object and a second one look for other types. But we do not support checking for null. So in your case that would be checking for any zval and then checking it's type. Thus you could check the number of arguments with ZEND_NUM_ARGS(), directly grab the zval and check for it's two allowed types using the old API.
marcus Friday, October 28, 2005, 12:08:28 AM, you wrote: > Thanks guys, the O! works as expected. It didn't need the | since I actually > want to force a parameter to be sent even if it is null. > I did think it was weird that the parse_parameter functions set the zval* > passed in to NULL instead of setting the value/type of the zval to IS_NULL. > This took a bit to debug since it is kinda outta step with the way Zend > handles zvals elsewhere. > BTW Marcus, nice work on the SPL stuff. > Bob > -----Original Message----- > From: Marcus Boerger [mailto:[EMAIL PROTECTED] > Sent: Thursday, October 27, 2005 11:40 AM > To: Rob Richards > Cc: Bob Silva; internals@lists.php.net > Subject: Re: [PHP-DEV] Accept null type hint in C > Hello Rob, > args, shit you're right! > > marcus > Thursday, October 27, 2005, 8:35:12 PM, you wrote: >> Marcus Boerger wrote: >>>Hello Bob, >>> >>> that's definitively wrong, actually there must be something wrong with >>>your code. The '|' is to ensure that the parameter is optional. Thus if > you >>>moit the param it's return value is untouched which means you have to >>>initaialize the returned zval * to null before passing its address to the >>>parsing functions. The only way "unknown" gets send back is when you >>>use an unhandled spec. But you are using "O" or did you actually missread >>>and took zero? (which would be plain bullshit) >>> >>>marcus >>> >>>Thursday, October 27, 2005, 5:47:36 PM, you wrote: >>> >>> >>> >>>>I tried the "|!O" and that really hoses things. >>>> >>>> >> Isn't it supposed to be |O! ? >> Rob > Best regards, > Marcus Best regards, Marcus -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php