PHP5 and zend_parse_parameters

php.internals

l0t3k

23 years ago
i have an OOP based extension for PHP5 which also uses exceptions extensively. it would seem more in character with OOP to throw an IllegalArgument exception or some-such when a parameter type does not meet our expectations. otherwise we end up with a tenuous mix of error handling styles. zend_parse_parameters_ex has the "quiet" flag, which helps greatly, but im left without a nice message to include with my exception. is it possible for some variation of zend_parse_parameters which passes back the error message ? id rather not pass back a generic message. or am i just being lazy <g> l0t3k

l0t3k

23 years ago
another alternative is to do two things : 1) create a standard PHP IllegalArgument exception 2) create another flag for zend_parse_parameters_ex ( ZEND_PARSE_PARAMS_ERRORS_AS_EXCEPTIONS) when this flag is set, an IllegalArgument exception is raised with the appropriate message. A FAILURE return value in this instance would let the caller know that the exception was raised. i actually think this is the cleaner way to go. l0t3k "L0t3k" <cshmoove@bellsouth.net> wrote in message news:20030413040828.37736.qmail@pb1.pair.com...
> zend_parse_parameters_ex has the "quiet" flag, which helps greatly,
but
> im left without a nice message to include with my exception. is it
possible
> for some variation of zend_parse_parameters which passes back the error > message ? id rather not pass back a generic message. or am i just being
lazy