Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:89931 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 51344 invoked from network); 30 Dec 2015 23:13:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Dec 2015 23:13:50 -0000 Authentication-Results: pb1.pair.com header.from=addw@phcomp.co.uk; sender-id=permerror Authentication-Results: pb1.pair.com smtp.mail=addw@phcomp.co.uk; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain phcomp.co.uk designates 78.32.209.33 as permitted sender) X-PHP-List-Original-Sender: addw@phcomp.co.uk X-Host-Fingerprint: 78.32.209.33 freshmint.phcomp.co.uk Received: from [78.32.209.33] ([78.32.209.33:40566] helo=mint.phcomp.co.uk) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CB/47-51216-E2564865 for ; Wed, 30 Dec 2015 18:13:50 -0500 Received: from addw by mint.phcomp.co.uk with local (Exim 4.72) (envelope-from ) id 1aEPwB-0000eM-KR for internals@lists.php.net; Wed, 30 Dec 2015 23:13:47 +0000 Date: Wed, 30 Dec 2015 23:13:47 +0000 To: internals@lists.php.net Message-ID: <20151230231347.GN18189@phcomp.co.uk> Mail-Followup-To: internals@lists.php.net References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Organization: Parliament Hill Computers Ltd User-Agent: Mutt/1.5.20 (2009-12-10) Subject: Re: [PHP-DEV] [RFC] Number Format Separator From: addw@phcomp.co.uk (Alain Williams) On Wed, Dec 30, 2015 at 11:00:55PM +0000, Davey Shafik wrote: > You mention no support for numeric strings, but how will settype($string, > int|float), intval(), floatval(), is_numeric() and ctype_digit() work with > this change? > > I do think if you don't change the semantics for strings to number > conversion (which I agree you can't due to BC breaks) there should be an > explicit way to support "1_000_000" => (int) 1_000_000. This should be part > of the RFC. > > I presume that if you were to go from numeric to string the underscores > would be stripped? What about a way not to do that? What will var_dump() > etc. show? I think that he is just talking about numeric constants in programs; he is not talking about run time strings (eg read from a file/form) being allowed to contain '_'. Perl does exactly what Thomas is proposing, it does improve readability. There is not a BC problem since today something like 1_000 is illegal as a constant in a program. I think that it is a good idea. -- Alain Williams Linux/GNU Consultant - Mail systems, Web sites, Networking, Programmer, IT Lecturer. +44 (0) 787 668 0256 http://www.phcomp.co.uk/ Parliament Hill Computers Ltd. Registration Information: http://www.phcomp.co.uk/contact.php #include