Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:38675 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 20032 invoked from network); 29 Jun 2008 03:42:54 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Jun 2008 03:42:54 -0000 Authentication-Results: pb1.pair.com smtp.mail=jordan@wambaugh.org; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=jordan@wambaugh.org; sender-id=unknown Received-SPF: error (pb1.pair.com: domain wambaugh.org from 74.125.46.31 cause and error) X-PHP-List-Original-Sender: jordan@wambaugh.org X-Host-Fingerprint: 74.125.46.31 yw-out-2324.google.com Received: from [74.125.46.31] ([74.125.46.31:56625] helo=yw-out-2324.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C4/A2-31823-BB407684 for ; Sat, 28 Jun 2008 23:42:52 -0400 Received: by yw-out-2324.google.com with SMTP id 5so487020ywb.83 for ; Sat, 28 Jun 2008 20:42:48 -0700 (PDT) Received: by 10.150.228.2 with SMTP id a2mr5484202ybh.245.1214710967793; Sat, 28 Jun 2008 20:42:47 -0700 (PDT) Received: from ?192.168.1.7? ( [70.161.167.72]) by mx.google.com with ESMTPS id y78sm10747526pyg.17.2008.06.28.20.42.46 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 28 Jun 2008 20:42:47 -0700 (PDT) Message-ID: <7A96DF9E-810E-4EFC-BB5F-3108FBD29F0D@wambaugh.org> To: PHP Internals In-Reply-To: Content-Type: multipart/mixed; boundary=Apple-Mail-24-180563741 Mime-Version: 1.0 (Apple Message framework v924) Date: Sat, 28 Jun 2008 23:42:44 -0400 References: <485AE658.3050204@zend.com> <043C48F1-00DF-4882-AB70-A368C5D32DA1@wambaugh.org> <7439A4DE-6DBA-405E-9210-C3819AD1E59B@wambaugh.org> X-Mailer: Apple Mail (2.924) Subject: Re: [PHP-DEV] cleaning up the functions - any volunteers? From: jordan@wambaugh.org (Jordan Wambaugh) --Apple-Mail-24-180563741 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit On Jun 28, 2008, at 3:20 PM, David Coallier wrote: > 2008/6/28 Jordan Wambaugh : >> >> 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. --Apple-Mail-24-180563741 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Jordan CM Wambaugh --Apple-Mail-24-180563741--