Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:86065 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 86278 invoked from network); 30 Apr 2015 04:55:27 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Apr 2015 04:55:27 -0000 Authentication-Results: pb1.pair.com smtp.mail=walterp@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=walterp@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.181 as permitted sender) X-PHP-List-Original-Sender: walterp@gmail.com X-Host-Fingerprint: 209.85.212.181 mail-wi0-f181.google.com Received: from [209.85.212.181] ([209.85.212.181:33418] helo=mail-wi0-f181.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F7/50-19182-EB5B1455 for ; Thu, 30 Apr 2015 00:55:26 -0400 Received: by wief7 with SMTP id f7so4179559wie.0 for ; Wed, 29 Apr 2015 21:55:23 -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=Og9c14WG7Khh8gACg76mKi0RPADXPHCZsG4dj5oL2A0=; b=VoHnUY2joxDYvpftsJiathQk7QhpB66XbiAxg7OWIS03PYYDU77/f8j52OBOXCYXHc 3eajiApiKEPpg11oby+j4TIR4AbtRO2nsVkIwJLl933vJwR1oDFcGMcKVjcCodxsyBmB zx9zNHr7FN3K1kH4eVAGK62PST8JAiTJMBUYpGgobbtlgP0i76EJGBZD1svrRmVHuOgJ e1D5b8zIH5O6fJ9ourv1uX69xxiFu6V4VbWJctrY2an3VsiqCYzYFRqY0XxhVPdIRu5I D8paTSW9C+H9iXgb5o/ywWSc+mRqgFAmrmlCqyZJB5pg9PQbLeCMupp7YVztJRXhwVXc OlrA== MIME-Version: 1.0 X-Received: by 10.194.235.71 with SMTP id uk7mr4630108wjc.13.1430369395770; Wed, 29 Apr 2015 21:49:55 -0700 (PDT) Received: by 10.27.227.11 with HTTP; Wed, 29 Apr 2015 21:49:55 -0700 (PDT) In-Reply-To: References: <55401F31.9030703@gmail.com> <55416849.9010808@gmail.com> <554176D6.2030007@gmx.de> <55418CBE.6050609@gmail.com> Date: Wed, 29 Apr 2015 21:49:55 -0700 Message-ID: To: Yasuo Ohgaki Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=089e01493afabb8a720514e9d3e6 Subject: Re: [PHP-DEV] Adding "numeric" type hint From: walterp@gmail.com (Walter Parker) --089e01493afabb8a720514e9d3e6 Content-Type: text/plain; charset=UTF-8 On Wed, Apr 29, 2015 at 9:33 PM, Yasuo Ohgaki wrote: > Hi Walter, > > On Thu, Apr 30, 2015 at 11:52 AM, Walter Parker wrote: > >> Are you asking to have both the 32 and 64 bit versions of PHP fully map >> to the type system in SQLite? The type system in SQLite appears to have >> been setup to map to programming language that lots of types (modern C, >> C++, maybe Java) rather than PHP. >> >> I think you might have an easier time fixing the SQLite adaptor for PHP >> than making both 32 and 64 bit PHP map to the type structure for SQLite >> completely transparently with full type defs. >> > > It's not a SQLite/etc access library issue, but the user code issue. > > Average PHP users will use int type hint for record IDs. This results in > fatal > error (or exception). These code does not have to be my/your code, but > other libraries written by someone else. > > Regards, > > -- > Yasuo Ohgaki > yohgaki@ohgaki.net > Then this is exactly why we need type hints. If the average user is using 32 ints to map to 64 bit values, then someone has written broken code. The code should fail with a type check error, not be automagically fixed if you are using types. At some point the programmer should take responsibility for matching the DB API to the code base. Hiding mistakes only sets up the uninformed users for mistakes later. Mixing 32 bit code/sizes with 64 code/sizes requires that you pay some attention to sizes. Do everything in 32 bit, not a problem. Do everything in 64 bit, not a problem. Mix the two and there is a cost. As far as a I can tell, they is little desire in the current day to make the 32/64 hybrid modes easier/simpler. This is a fact that people will have live with (or do the work themselves). I see it as a legacy issue that is becoming more and more irrelevant. It would be nice to help, but it may setup future legacy issues that we would rather not support. Walter -- The greatest dangers to liberty lurk in insidious encroachment by men of zeal, well-meaning but without understanding. -- Justice Louis D. Brandeis --089e01493afabb8a720514e9d3e6--