Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80832 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 697 invoked from network); 19 Jan 2015 15:57:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Jan 2015 15:57:26 -0000 Authentication-Results: pb1.pair.com smtp.mail=francois@tekwire.net; spf=softfail; sender-id=softfail Authentication-Results: pb1.pair.com header.from=francois@tekwire.net; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain tekwire.net does not designate 212.27.42.2 as permitted sender) X-PHP-List-Original-Sender: francois@tekwire.net X-Host-Fingerprint: 212.27.42.2 smtp2-g21.free.fr Received: from [212.27.42.2] ([212.27.42.2:48468] helo=smtp2-g21.free.fr) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8E/DA-64889-4692DB45 for ; Mon, 19 Jan 2015 10:57:26 -0500 Received: from moorea (unknown [82.240.16.115]) by smtp2-g21.free.fr (Postfix) with ESMTP id F1A164B02B9; Mon, 19 Jan 2015 16:54:51 +0100 (CET) Reply-To: To: , "Nikita Popov" , "Sara Golemon" , "Andrea Faulds" , Date: Mon, 19 Jan 2015 16:57:19 +0100 Message-ID: <008201d03400$9b5f1ad0$d21d5070$@tekwire.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 14.0 Thread-Index: AdAz/Wt+LYKoub9pTFGl9V8qPh31HA== Content-Language: fr X-Antivirus: avast! (VPS 150119-0, 19/01/2015), Outbound message X-Antivirus-Status: Clean Subject: Re: [PHP-DEV] PHP 7 API naming conventions: str vs string From: francois@tekwire.net (=?iso-8859-1?Q?Fran=E7ois_Laupretre?=) Hi, On Sun, Jan 4, 2015 at 1:57 AM, Sara Golemon wrote: > On Sat, Jan 3, 2015 at 3:42 PM, Nikita Popov = wrote: > > Or maybe be more explicit and use "cstr" for C strings. (For = symmetry the > > zend_string type could become zstr.) > > > I personally prefer cstr/zstr for explicitness, but agree that the > main focus should be consistency. > Do you mean Z_STRVAL would become Z_CSTRVAL ? Argh... I would suggest that references to zstrings should always be prefixed = with a 'z', no matter if it is 'zstr' or 'zstring'. This way, when you see = 'str' or 'string' in a name, you know it cannot be a zend string. The only = exception would be the 'zend_string' type itself but even 'zend_string' in = function names should be replaced because you cannot know if the 'zend_' = substring is just part of the function name or refers to the 'zend_string' type. Making a difference between 'str' and 'string' is too cryptic and not intuitive. And what about a new future string type ? Use 'st' or 'stri' = :) ? ZVAL_STR would become ZVAL_ZSTR, for instance. Some may find it = redundant but the 'Z' of ZVAL and the the one of 'ZSTR' have nothing in common. cstr/cstring would be fine for a new project but the BC break is = terrible. Even for new functions/macros, I would keep str/string for C strings = because consistency is the most important. Cheers Fran=E7ois