Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:86071 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 98947 invoked from network); 30 Apr 2015 06:40:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Apr 2015 06:40:26 -0000 Authentication-Results: pb1.pair.com header.from=arvids.godjuks@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=arvids.godjuks@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.181 as permitted sender) X-PHP-List-Original-Sender: arvids.godjuks@gmail.com X-Host-Fingerprint: 209.85.217.181 mail-lb0-f181.google.com Received: from [209.85.217.181] ([209.85.217.181:33756] helo=mail-lb0-f181.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3D/21-27026-95EC1455 for ; Thu, 30 Apr 2015 02:40:26 -0400 Received: by lbbzk7 with SMTP id zk7so37176584lbb.0 for ; Wed, 29 Apr 2015 23:40:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=qybFwb0RSulf7GZFrCzWCjiZvGvSbBSAx0gvoi5h7N4=; b=m2Bv6LIGdN1G/1kh7UKVfvWZ4RJ8n+egmlBEWJnEW/anrhARmI9HkvJr1SwSdaZloO nL975IQi150t0s4ZmH9QE9Xn16nuKEb7IRIMCGYUu1CHFB94rAGg0ejtA9nFqlb1kGCb RP2YQ8/NZEkTIEya84IUxU1IC+h8rCykqwjaG3/Dwe0UGS1vPU79So8U7E3nXorewcoS /r9BheaK11wAUmaWlWKlXL9tpzeTWvKlUMoqAcbZBRrTSH0iMxxFRkRwHhj+emIOt4fL C92pjqLmiTYQGh9be754KE1YwGbrLueeO8qukYC/H3xtdzJdoNokj6sBraewT5eX6sf8 hnag== X-Received: by 10.112.77.103 with SMTP id r7mr2363322lbw.63.1430376022227; Wed, 29 Apr 2015 23:40:22 -0700 (PDT) MIME-Version: 1.0 Received: by 10.25.32.74 with HTTP; Wed, 29 Apr 2015 23:40:01 -0700 (PDT) In-Reply-To: References: <55401F31.9030703@gmail.com> <55416849.9010808@gmail.com> <5541753D.5050908@gmail.com> <55419C0C.7020207@gmail.com> <5541C0E0.2080006@gmail.com> Date: Thu, 30 Apr 2015 09:40:01 +0300 Message-ID: To: Walter Parker Cc: Stanislav Malyshev , Yasuo Ohgaki , Ryan Pallas , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a11c3f026b343ff0514eb5e78 Subject: Re: [PHP-DEV] Adding "numeric" type hint From: arvids.godjuks@gmail.com (Arvids Godjuks) --001a11c3f026b343ff0514eb5e78 Content-Type: text/plain; charset=UTF-8 > > Stop trying to fix clever idiots from shooting themselves in the foot. The > standard result from these actions is to make life a pain for regular or > better programmers while only adding mild speed bumps to those clever > idiots. > > Things like a numeric type will only encourage the clever idiots to write > half broken code. > Hello, just want to chip in. I use "INT UNSIGNED" for the MySQL primary keys since ages, because negative primary keys make no sense. Well, mostly ID's for the records actually can stay strings, but I will have to remember to use a string type hint every time I pass a record ID. I expect a lot of times to forget that and write int... I was bitten a few times by the limits of 32 bit integer sizes too (moved to a 64 bit server that time), but there are also unsigned 64 bit integers that can and will be used in math operations and passed around. And we don't have the "unsigned int". Okay, we have GMP. I will have to use it. But let me just ask - if I work with a DB handling 64 bit integers (all I know handle them) or use a DECIMAL field - automaticly use GMP then? Oh gosh.... Arvids. --001a11c3f026b343ff0514eb5e78--