Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75969 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 76006 invoked from network); 23 Jul 2014 18:21:40 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Jul 2014 18:21:40 -0000 Authentication-Results: pb1.pair.com header.from=rewilliams@thesba.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rewilliams@thesba.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain thesba.com designates 208.106.205.210 as permitted sender) X-PHP-List-Original-Sender: rewilliams@thesba.com X-Host-Fingerprint: 208.106.205.210 ntsexchedgea1.newtekemail.com Received: from [208.106.205.210] ([208.106.205.210:28231] helo=ntsexchedgea1.newtekemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7D/70-06925-23DFFC35 for ; Wed, 23 Jul 2014 14:21:39 -0400 Received: from NTSEXCHHUBA1.NTS.PHX1 (208.106.205.208) by NTSEXCHEDGEA1.newtekemail.com (208.106.205.210) with Microsoft SMTP Server (TLS) id 8.3.348.2; Wed, 23 Jul 2014 11:21:32 -0700 Received: from NTSEXCHA1CMB2.NTS.PHX1 ([fe80::1c54:1501:a334:b20a]) by NTSEXCHHUBA1.NTS.PHX1 ([2002:d06a:cdd0::d06a:cdd0]) with mapi; Wed, 23 Jul 2014 11:21:37 -0700 To: "internals@lists.php.net >> PHP Internals" Date: Wed, 23 Jul 2014 11:21:37 -0700 Thread-Topic: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening) Thread-Index: Ac+movBgTo9DEJdsR/q2Ma7LcdTsAA== Message-ID: <7E1578C5-30DE-46CE-B3CA-AFA9F7FA1B6B@thesba.com> References: <08503591-EFC8-48E6-984E-FFC292C5EA5F@ajf.me> <53C2178E.7070705@sugarcrm.com> <53CB70BC.4020001@php.net> <53CC0A75.6010200@sugarcrm.com> In-Reply-To: <53CC0A75.6010200@sugarcrm.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening) From: rewilliams@thesba.com (Robert Williams) On Jul 14, 2014, at 10:13, Andrea Faulds wrote: > We are using hack=92s syntax (int, float, bool, string, no integer/double= /boolean aliases). On 20 Jul 2014, at 14:11, Andrea Faulds wrote: > The patch actually warns you if you try to do this now: > > function foo(double $foo) {} > foo(1.0); > > If you use one of the non-existent aliases (double), and pass the type th= at alias is supposed to hint for (a float), the error message notes you mig= ht be looking for the actual type hint (`float`). It seems odd to me to not support the aliases. Since I can do this: $foo =3D (integer)$bar; I would expect to be able to do this: function foo(integer $param) {} Also, do int, float, and numeric accept numbers in octal, hex, scientific n= otation, etc.? I don=92t believe there are any examples in the RFC that int= entionally or accidentally show what happens with, say, 0x2f as a value. -- Bob Williams SVP, Software Development Newtek Business Services, Inc. =93The Small Business Authority=94 http://www.thesba.com/ Notice: This communication, including attachments, may contain information = that is confidential. It constitutes non-public information intended to be = conveyed only to the designated recipient(s). If the reader or recipient of= this communication is not the intended recipient, an employee or agent of = the intended recipient who is responsible for delivering it to the intended= recipient, or if you believe that you have received this communication in = error, please notify the sender immediately by return e-mail and promptly d= elete this e-mail, including attachments without reading or saving them in = any manner. The unauthorized use, dissemination, distribution, or reproduct= ion of this e-mail, including attachments, is prohibited and may be unlawfu= l. If you have received this email in error, please notify us immediately b= y e-mail or telephone and delete the e-mail and the attachments (if any).