Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80130 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 15275 invoked from network); 3 Jan 2015 23:46:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Jan 2015 23:46:55 -0000 Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 192.64.116.216 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 192.64.116.216 imap10-3.ox.privateemail.com Received: from [192.64.116.216] ([192.64.116.216:35738] helo=imap10-3.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EE/A0-11248-E6F78A45 for ; Sat, 03 Jan 2015 18:46:54 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id A91732400C2; Sat, 3 Jan 2015 18:46:51 -0500 (EST) X-Virus-Scanned: Debian amavisd-new at imap10.ox.privateemail.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap10.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id FoJPD6qfzAtU; Sat, 3 Jan 2015 18:46:51 -0500 (EST) Received: from [192.168.0.13] (unknown [94.13.96.117]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id 692012400A9; Sat, 3 Jan 2015 18:46:50 -0500 (EST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) In-Reply-To: Date: Sat, 3 Jan 2015 23:46:15 +0000 Cc: PHP internals Content-Transfer-Encoding: quoted-printable Message-ID: References: To: Nikita Popov X-Mailer: Apple Mail (2.1993) Subject: Re: [PHP-DEV] PHP 7 API naming conventions: str vs string From: ajf@ajf.me (Andrea Faulds) Hey Nikita, > On 3 Jan 2015, at 23:42, Nikita Popov wrote: >=20 > Basically if you have two APIs, one using str, the other using string, = you > can't tell which one is for C strings and which one is for = zend_strings. It > could be either way. >=20 > It would be nice to have a convention for this and stick with it. E.g. > "string" is for zend_strings and "str" for C strings. >=20 > Or maybe be more explicit and use "cstr" for C strings. (For symmetry = the > zend_string type could become zstr.) The abbreviation seems rather pointless, I=E2=80=99d rather string over = str. I=E2=80=99d suggest this convention: * Use =E2=80=9Cstring=E2=80=9D or omit the suffix for zend_string * Use =E2=80=9Ccstring=E2=80=9D for C strings (char*) * Don=E2=80=99t use =E2=80=9Cstr=E2=80=9D That sound good? -- Andrea Faulds http://ajf.me/