Hello

I'm wondering if there is a recommended way to validate a multi-type parameter
in an internal function. If a parameter is expected to be "long or string" or
to be "integer or null", a simple call to `zend_parse_parameters()` won't
validate it.

I read some extensions' code, and it seems that the preferred method is to call
`zend_parse_parameters(_ex)` several times until one validation succeeds or all
fail. I really don't like this solution. Maybe the performance penalty of
parsing twice the arguments is negligible, but I don't even like the idea of
this code. Isn't there a better solution? Or did I miss a good reason for this?

I wanted to use `zend_parse_arg()` to validate a single parameter if the
first call to `zend_parse_parameters_ex()` wasn't successful. But this function
is never used outside of "Zend/zend_API.c". Is it meant for public use? Are
there any drawbacks in calling it?

Regards
--
François Gannaz

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

Reply via email to