I'll take a few

2008/6/20 Stanislav Malyshev <[EMAIL PROTECTED]>:

> Hi!
>
> While we nearing the release of 5.3 (hopefully?), there are many functions
> in the PHP code which still use old parameter parsing API
> (zend_get_parameters_ex) instead of the new one (zend_parse_parameters).
>
> I have cleaned up Zend engine functions, converting them to the new API,
> but there are about 1000 instances throughout PHP code (especially
> ext/standard) which still use the old way. This way is less correct,
> inconsistent with the new code, gives worse error messages, more prone to
> various bugs, etc. All new extensions and functions use the new way, and the
> only reason for keeping the old way in the code seems to be that nobody
> cleaned it up. Somebody has to bring the old ones into sync, and I don't
> think I personally will have time to do it in near timeframe. So if anybody
> could step up to that - by doing at least part of the work - that'd be
> great. The work is pretty simple, taking something like:
>
> zval **data;
>
> if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &data) == FAILURE) {
>        WRONG_PARAM_COUNT;
> }
> convert_to_string_ex(data);
>
> and move it into:
>
> char *str;
> int str_len;
>
> if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len)
> == FAILURE) {
>        return;
> }
>
> and of course convert use of data zval into use of str.
>
> This needs to be done carefully as not to break things on some more tricky
> functions which may get arguments of multiple types, etc. Also, some tests
> which check error messages may need to be fixed since new API gives more
> detailed messages.
> zend_parse_parameters documented here:
> http://www.php.net/manual/en/internals2.ze1.zendapi.php
> though some of the newer parameters aren't (C, h, f, Z) so one may need to
> look at the code at zend_API.c.
>
> P.S. if some genius would invent a script to automate that - it'd be
> awesome, but I don't have very high hopes on that. :)
> --
> Stanislav Malyshev, Zend Software Architect
> [EMAIL PROTECTED]   http://www.zend.com/
> (408)253-8829   MSN: [EMAIL PROTECTED]
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Slan,
David

Reply via email to