Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:86179 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 60997 invoked from network); 12 May 2015 19:57:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 May 2015 19:57:55 -0000 Authentication-Results: pb1.pair.com smtp.mail=derokorian@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=derokorian@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.182 as permitted sender) X-PHP-List-Original-Sender: derokorian@gmail.com X-Host-Fingerprint: 209.85.212.182 mail-wi0-f182.google.com Received: from [209.85.212.182] ([209.85.212.182:33821] helo=mail-wi0-f182.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 38/B3-41925-14B52555 for ; Tue, 12 May 2015 15:57:54 -0400 Received: by wicmc15 with SMTP id mc15so62317156wic.1 for ; Tue, 12 May 2015 12:57:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=C9JwciF3rYwXf0UgEm83GxacAVzhD7IN9+PaSJTloJM=; b=VlH36pMOaz8EvtSbbcffZLv3T84GjlH0/5/X1KyRz1YWxdj/lY7cL+3x2wmlUy8LRC YvvYWCTttw7HvbwmfxS9S12aPaCLdo2feWPpDnM6UsYh9EmE6sIjZJzm5pIbZhaiyXLe rcbG31Zftm2GpBRvn105sEmAezEph2wRE4+hQuWBIcmuz3FtnNeGbGYQ5XMWi8jGc7cg zogbfvGmcvEZzXrxj47LcPU5qo0r39JyANxrekzL/kLjUZUUEwt/SLHcLpsN71pQL8Zy U2kcINCkS/LvGFjyXNNXiDhPDgivJ4KSWBcpdiZO4XuhMbCMOPPExkJQBrLOubuzZKXH FS9A== MIME-Version: 1.0 X-Received: by 10.180.91.40 with SMTP id cb8mr32393326wib.64.1431460669982; Tue, 12 May 2015 12:57:49 -0700 (PDT) Received: by 10.28.7.196 with HTTP; Tue, 12 May 2015 12:57:49 -0700 (PDT) In-Reply-To: <5552540C.9000205@lsces.co.uk> References: <5552540C.9000205@lsces.co.uk> Date: Tue, 12 May 2015 13:57:49 -0600 Message-ID: To: Lester Caine Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=f46d043c7e78be8dfc0515e7e86b Subject: Re: [PHP-DEV] is_digits() and digits type From: derokorian@gmail.com (Ryan Pallas) --f46d043c7e78be8dfc0515e7e86b Content-Type: text/plain; charset=UTF-8 On Tue, May 12, 2015 at 1:27 PM, Lester Caine wrote: > On 12/05/15 19:55, Rowan Collins wrote: > > For instance, valid input for a 64-bit signed integer in a database > could include: > > - any PHP native integer (assuming nobody builds with 128-bit ints!) > > - any string consisting of all digits, such that when interpreted as an > integer the value won't exceed 2^64-1 > > - any string consisting of a '-' followed by digits, such that the > magnitude of the integer interpretation wouldn't exceed 2^64 > > - any PHP float with no fractional part, maybe capped to a magnitude > less than 2^53 for safety > > BUT > In INTEGER in a database is 32 bit and will remain 32 bit, just as > SMALLINT is 16 bit ... 64 bit is BIGINT and so the whole concept of > simply ignoring 32 bit and handling them instead as 64bit is wrong! > So type hints are broken before they start! > You should handle sanitizing data for you external storage specific to the external storage you're using and not expect the language to do it for you. > > -- > Lester Caine - G8HFL > ----------------------------- > Contact - http://lsces.co.uk/wiki/?page=contact > L.S.Caine Electronic Services - http://lsces.co.uk > EnquirySolve - http://enquirysolve.com/ > Model Engineers Digital Workshop - http://medw.co.uk > Rainbow Digital Media - http://rainbowdigitalmedia.co.uk > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --f46d043c7e78be8dfc0515e7e86b--