Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77169 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 90917 invoked from network); 14 Sep 2014 00:07:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Sep 2014 00:07:24 -0000 Authentication-Results: pb1.pair.com smtp.mail=addw@phcomp.co.uk; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=addw@phcomp.co.uk; sender-id=permerror 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:56043] helo=mint.phcomp.co.uk) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D4/ED-27276-93CD4145 for ; Sat, 13 Sep 2014 20:07:22 -0400 Received: from addw by mint.phcomp.co.uk with local (Exim 4.72) (envelope-from ) id 1XSxLa-00075c-5R for internals@lists.php.net; Sun, 14 Sep 2014 01:07:18 +0100 Date: Sun, 14 Sep 2014 01:07:18 +0100 To: internals@lists.php.net Message-ID: <20140914000718.GB14312@phcomp.co.uk> Mail-Followup-To: internals@lists.php.net References: <6893A97A-EC4C-4124-B804-96E2A26B953F@ajf.me> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <6893A97A-EC4C-4124-B804-96E2A26B953F@ajf.me> Organization: Parliament Hill Computers Ltd User-Agent: Mutt/1.5.20 (2009-12-10) Subject: Re: [PHP-DEV] [VOTE][RFC] Scalar Type Hinting with Cast From: addw@phcomp.co.uk (Alain Williams) On Sun, Sep 14, 2014 at 12:30:40AM +0100, Andrea Faulds wrote: > Good evening, > > I’ve given up on my plan B, so I’m putting this RFC, finally, to a vote. > > I would urge you to vote in favour. It is not going to please everyone, it is after all a compromise proposal. However, I have tried my best to strike a balance between complete weak typing and strict typing. If this passes, we will finally have userland type specifiers for scalar types. It’s not perfect, but I’d argue it’s far better than nothing. > > Voting starts today, 2014-09-14, and ends in a week’s time, 2014-09-21. > > Thanks! > > https://wiki.php.net/rfc/scalar_type_hinting_with_cast#vote You give an option for float to int casting to truncate. You give an example of truncating a positive float in that it rounds down towards 0 - ie 1.5 becomes 1. What happens with negaitve numbers ? Do you round towards zero or round in a negative direction ? So, should -1.5 become -1 or -2 ? Or should it depend on the floating point unit on the machine (not all do the same) ? Currently PHP (CentOS on an AMD CPU) a cast to int converts -1.5 to -1. -- 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