Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:71049 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 34637 invoked from network); 10 Jan 2014 23:11:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Jan 2014 23:11:28 -0000 Authentication-Results: pb1.pair.com header.from=ab@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=ab@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 85.214.73.107 as permitted sender) X-PHP-List-Original-Sender: ab@php.net X-Host-Fingerprint: 85.214.73.107 klapt.com Received: from [85.214.73.107] ([85.214.73.107:43414] helo=klapt.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6C/D4-12207-D1E70D25 for ; Fri, 10 Jan 2014 18:11:27 -0500 Received: by klapt.com (Postfix, from userid 33) id 65B9C23D6080; Sat, 11 Jan 2014 00:11:22 +0100 (CET) Received: from 188.110.167.245 (SquirrelMail authenticated user anatol@belski.net) by webmail.klapt.com with HTTP; Sat, 11 Jan 2014 00:11:22 +0100 Message-ID: In-Reply-To: References: Date: Sat, 11 Jan 2014 00:11:22 +0100 To: "Nikita Popov" Cc: "PHP Developers Mailing List" Reply-To: "Anatol Belski" User-Agent: SquirrelMail/1.5.2 [SVN] MIME-Version: 1.0 Content-Type: text/plain;charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] [RFC] 64 bit platform improvements for string length and integer From: ab@php.net ("Anatol Belski") Hi Nikita, On Fri, January 10, 2014 22:42, Nikita Popov wrote: > On Fri, Jan 10, 2014 at 3:58 PM, Anatol Belski wrote: > > >> Hi, >> >> >> https://wiki.php.net/rfc/size_t_and_int64 >> >> >> The discussion time has come. The work on the feature branch continues. >> The current patch is stable enough to be discussed. >> >> > > What is the reason behind the renames of IS_LONG to IS_INT (and Z_LVAL to > Z_IVAL etc), as well as the renames in zpp (s -> S, etc)? Why can't we > keep the old names here? That should reduce the amount of ifndefs involved > a lot, as you'd only have to do it for the type declarations themselves, > not for every single usage. Or is the point here to intentionally provide > a maximum amount of BC breakage, so code doesn't "accidentally" continue > to run (e.g. I think that without the renames extensions could continue to > run mostly without issue on 32bit.) > > Nikita > the renames you mention like IS_LONG -> IS_INT are thought more for correct semantic, as there is no firm 'long' anymore. The same for Z_STRLEN -> Z_STRSIZE and others. That kind of thing should be done the most obvious way. Well, the max BC reason you gave I like too :) For the same reason zend_parse_parameters() formats was changed, as it'll issue an error on runtime. However here I still scratch my head as that's a runtime issue, but it should break the compilation as well. Without semantic replacements many extensions would just continue to compile/run on 32 bit, indeed. Though because of the size_t one could still have some unpleasant surprise in some situation. Besides that, I'd really see that more like a side effect with not very clear use. With the #ifdef's - there shouldn't be any or should be very few. The compatibility header I've mentioned in one of the previous responses should do it one for all. It can look like #if PHP_MAJOR_VERSION < 6 # define IS_INT IS_LONG # define php_size_t int ....... #endif Once included and given an extension is compiled with an older PHP version, that defines should cover the compatibility with older semantics. Some more complicated solution will probably be needed for zpp to replace "i" with "l" and co. for the older PHP. But generally, such a header should make the same ext source in 6.x style compatible with 5.x branch. Of course some exceptions will have to take place, but i think those will be not more than the current mainstream already contains to separate the code for minor versions in 5.x branch. The migration path is the very next thing I have to do. Regards Anatol