Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:38502 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 40541 invoked from network); 21 Jun 2008 21:24:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Jun 2008 21:24:57 -0000 Authentication-Results: pb1.pair.com smtp.mail=indeyets@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=indeyets@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.198.225 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: indeyets@gmail.com X-Host-Fingerprint: 209.85.198.225 rv-out-0506.google.com Received: from [209.85.198.225] ([209.85.198.225:16375] helo=rv-out-0506.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8B/55-26505-5A17D584 for ; Sat, 21 Jun 2008 17:24:55 -0400 Received: by rv-out-0506.google.com with SMTP id g37so7242496rvb.23 for ; Sat, 21 Jun 2008 14:24:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type:references; bh=hQWp9bnwWmnmuh/oIkOJXjqH48AO6Orv3nT3RFLfz2E=; b=w9raIw0jsHkbUN+7nh4CsPnFjqxPM0DPmzzB6fUSp3+oWL/Q7vaI31YizLppTycmCa AtYzDYUmNJl8/iNLqC7GoyKoBhCH8ppbURpMCRtUuh/qjdqs5oNsxFeB9DpIeotKcu/C sA4FAwseqwhUn99JehObrTT0KhDi52xEBsRdI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:references; b=kSfzw8hu+CSS6hvi67Ko3MiTeBJ8QOszSMK7lL6xpVOHRfJ8G69yb1sK5iz7dMTf7P pxV51bN4vDxLnspVoCZjtEElL+FZPV5U47aZcMvVQpzCmD2IQ0eVoD5B9wPwxbn5qtry aZM4TqN6R3N2Lk96AlzzkcYsf72x4P20T3etY= Received: by 10.141.33.21 with SMTP id l21mr9993539rvj.105.1214083490526; Sat, 21 Jun 2008 14:24:50 -0700 (PDT) Received: by 10.150.158.8 with HTTP; Sat, 21 Jun 2008 14:24:50 -0700 (PDT) Message-ID: Date: Sun, 22 Jun 2008 01:24:50 +0400 To: "Stanislav Malyshev" Cc: "PHP Internals" In-Reply-To: <485AE658.3050204@zend.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_17646_2430873.1214083490472" References: <485AE658.3050204@zend.com> Subject: Re: [PHP-DEV] cleaning up the functions - any volunteers? From: indeyets@gmail.com ("Alexey Zakhlestin") ------=_Part_17646_2430873.1214083490472 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline I did curl for 5.3 On 6/20/08, Stanislav Malyshev wrote: > 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 > stas@zend.com http://www.zend.com/ > (408)253-8829 MSN: stas@zend.com > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Alexey Zakhlestin http://blog.milkfarmsoft.com/ ------=_Part_17646_2430873.1214083490472--