On Jun 28, 2008, at 3:20 PM, David Coallier wrote:
2008/6/28 Jordan Wambaugh <[EMAIL PROTECTED]>:
On Jun 28, 2008, at 7:27 AM, David Coallier wrote:
The idea of the new parsing parameter is to catch the number of
parameters as well. For instance when you have
if (ZEND_NUM_ARGS() < 2) {
WRONG_PARAM_COUNT;
}
then your zend parse param function call should have 2 params or
more
Ex:
int argc;
char *name;
zval **other;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sZ", &name,
&other, &argc) == FAILURE) {
return;
}
This way of parsing the parameters remove the ZEND_NUM_ARGS() and
WRONG_PARAM_COUNT and adds consistency in the return error messages
across the language.
Also next time please read the previous entries of the thread :
See: http://url.ie/hck that was about the 3rd or 4th message.
Anyways that's ok, I lot of conflicts now in formatted_print.c and
assert.c but I'll work around them to get the resolved. We just have
to get organized on which files we'll be working on then. Right now,
Olivier is working on file.c and has done string.c so please don't
do
those 2 files.
Ok, sorry, I didn't catch the thread where you said you were going
to work
on standard. Do you want me to fix it so I'm not checking
ZEND_NUM_ARGS, or
should I just leave that to you?
Go ahead, you are pretty well started, I'll adjust after you are
done :)
Alright, I rewrote my patches for basic_functions.c, assert.c, and
formatted_print.c (attached) a few notes:
fprintf and vsprintf - I'm not sure if this is the appropriate way to
work with a variable number of parameters, please let me know if there
is a better way. Also, because zend_parse_parameters is generating a
different error message if you don't pass enough parameters, the
*_error tests are failing. I didn't want to change any of the tests
until my patch has been reviewed, in case changes need to be made.
Also, set_magic_quotes_runtime is not issuing a deprecated warning,
but the test is expecting it, causing some tests to fail. I noticed in
the documentation (http://us3.php.net/manual/en/function.set-magic-quotes-runtime.php
) that its not documented as being deprecated, so I'm not sure what
the expectation should be in the test.
Jordan CM Wambaugh
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php