Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:71064 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 96111 invoked from network); 11 Jan 2014 15:29:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Jan 2014 15:29:50 -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:55587] helo=klapt.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1E/83-10544-B6361D25 for ; Sat, 11 Jan 2014 10:29:49 -0500 Received: by klapt.com (Postfix, from userid 33) id 5234923D6080; Sat, 11 Jan 2014 16:29:43 +0100 (CET) Received: from 188.110.167.245 (SquirrelMail authenticated user anatol@belski.net) by webmail.klapt.com with HTTP; Sat, 11 Jan 2014 16:29:43 +0100 Message-ID: <2e9df2840916d6e72255764a08086e57.squirrel@webmail.klapt.com> In-Reply-To: References: <10f19e40b03ee19837010a988eb05706.squirrel@webmail.klapt.com> Date: Sat, 11 Jan 2014 16:29:43 +0100 To: "Jakub Zelenka" Cc: "Hannes Magnusson" , "Nikita Popov" , "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") On Sat, January 11, 2014 16:05, Jakub Zelenka wrote: > On Sat, Jan 11, 2014 at 2:48 PM, Anatol Belski wrote: > > >> the range checks is what 'L' vs 'I' would stand for, the 'L' would be >> available as alias for 'I', so one don't has to change zpp. A good >> thing were to add type checks, >> >> > Oh I see. The only small objection is that these lines could lead to the > unexpected result from the user point of view: > > if (d > ZEND_INT_MAX) { *p = ZEND_INT_MAX; > break; } else if (d < ZEND_INT_MIN) { > *p = ZEND_INT_MIN; > break; } > > > I think that would make sense to add warning here > > > Also similar checks for "s" and "p" length part (size_t -> int) would be > great too! ;) > yep, that's exactly how it performs till now in the mainstream, just replace ZEND_INT_MAX with LONG_MAX. Adding a warning to every such case would cause a warning flood in many PHP apps, guaranteed :) Whereby it might be ok for debug mode maybe, I wouldn't do it as I can't remember any WTFs about the behavior. Cheers Anatol