Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:83054 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 98071 invoked from network); 18 Feb 2015 12:27:48 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Feb 2015 12:27:48 -0000 Authentication-Results: pb1.pair.com header.from=francois@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=francois@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 212.27.42.2 as permitted sender) X-PHP-List-Original-Sender: francois@php.net X-Host-Fingerprint: 212.27.42.2 smtp2-g21.free.fr Received: from [212.27.42.2] ([212.27.42.2:46658] helo=smtp2-g21.free.fr) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 08/9D-18888-24584E45 for ; Wed, 18 Feb 2015 07:27:47 -0500 Received: from moorea (unknown [82.240.16.115]) by smtp2-g21.free.fr (Postfix) with ESMTP id A7BD04B0267; Wed, 18 Feb 2015 13:27:23 +0100 (CET) Reply-To: To: "'Andrey Andreev'" , "'Zeev Suraski'" Cc: "'Nikita Popov'" , "'Rasmus Lerdorf'" , "'Sara Golemon'" , "'PHP internals'" References: <54E3E27B.2010903@lerdorf.com> <2f99c47df51fa6c73131032ec50fade0@mail.gmail.com> In-Reply-To: Date: Wed, 18 Feb 2015 13:27:40 +0100 Message-ID: <030901d04b76$4a1fb340$de5f19c0$@php.net> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQKz6wpj8b81mnwJq1LfxWbU4ZJyQgGjcksIAbrU1N8Bn0wufQGLyLi6AmixSwea54FN8A== Content-Language: fr X-Antivirus: avast! (VPS 150217-2, 17/02/2015), Outbound message X-Antivirus-Status: Clean Subject: RE: [PHP-DEV] Scalar Type Hints v0.4 From: francois@php.net (=?utf-8?Q?Fran=C3=A7ois_Laupretre?=) Hi Andrey, > De : Andrey Andreev [mailto:narf@devilix.net] > > I too am curious about the potential issue with "123" to 123 > specifically, although it could be seen as a subset of another problem > that is solved with strict hints - numeric-character string > identifiers being erroneously treated as integers. Please give use cases. Do you want to support '0xhexa' strings ? that's = possible. We are not only restricting possible conversions, we can also = support additional syntaxes. Just give use cases for what you think = should be enabled or disabled, compared to the current behavior. The only change we have in list so far about (string -> number) is = rejecting trailing chars (but accepting trailing blanks). We are in the process of changing these rules so, please give examples = of ' numeric-character string identifiers being erroneously treated as = integers'. If you mean '7 years', it's in list already. If others, tell = us. > That is especially bad when such identifiers are in fact generated as > integers first so that they are incremental, but the > program/database/business logic requires them to be fixed-length > strings and/or in hexadecimal format. In such cases, even silently > discarding leading zeros can prove to be problematic, while in the > case of hexadecimal representations you'd need more than 10 data > samples to notice the problem if you don't use a strict hint. Do you mean we should accept hexadecimal string as int ? why not ? Give = exact syntax(es) you want to support (except leading/trailing blanks, = which are default now). Regards Fran=C3=A7ois