Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:105070 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 40144 invoked from network); 4 Apr 2019 13:53:55 -0000 Received: from unknown (HELO mail4.serversure.net) (185.153.204.204) by pb1.pair.com with SMTP; 4 Apr 2019 13:53:55 -0000 Received: (qmail 15025 invoked by uid 89); 4 Apr 2019 10:49:31 -0000 Received: by simscan 1.3.1 ppid: 15019, pid: 15022, t: 0.0378s scanners: attach: 1.3.1 clamav: 0.96/m:52/d:10677 Received: from unknown (HELO ?10.0.0.7?) (lester@lsces.co.uk@81.138.11.136) by mail4.serversure.net with ESMTPA; 4 Apr 2019 10:49:31 -0000 To: internals@lists.php.net References: <40683e93-f8e9-5a8c-9646-31c73c99396f@fischer.name> Message-ID: <62b133a7-442a-b6e9-675e-92e0fd776a57@lsces.co.uk> Date: Thu, 4 Apr 2019 11:49:31 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Permit trailing whitespace in numeric strings From: lester@lsces.co.uk (Lester Caine) On 06/03/2019 08:58, Nikita Popov wrote: > 1. What is more important to me here than strictness is consistency. Either > both " 123" and "123 " are numeric, or neither are. Making "123 " > numeric is a change we can easily do, because it makes the numeric string > definition more permissive and is thus mostly backwards compatible. Doing > the reverse change is certainly not compatible and will be a much harder > sell. I think it may be worth pointing out here the distinction at least with Firebird and I thought with other databases? A CHAR field is always returned padded with spaces to it's length, while a VARCHAR field is always trimmed to the last non space character. There are often reasons for using CHAR although many of those are probably historic, but trimming them without proper consideration is less than ideal. Returning historic material where numeric data is right justified in a CHAR field is equally valid. Handling these has always required care and it would be preferable that both returned the same result without having to trim and perhaps creating problems when the padded version needs to be returned ... -- Lester Caine - G8HFL ----------------------------- Contact - https://lsces.co.uk/wiki/?page=contact L.S.Caine Electronic Services - https://lsces.co.uk EnquirySolve - https://enquirysolve.com/ Model Engineers Digital Workshop - https://medw.co.uk Rainbow Digital Media - https://rainbowdigitalmedia.co.uk