Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:44655 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 56929 invoked from network); 2 Jul 2009 14:17:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Jul 2009 14:17:37 -0000 Authentication-Results: pb1.pair.com header.from=jbondc@openmv.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=jbondc@openmv.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain openmv.com from 64.15.152.204 cause and error) X-PHP-List-Original-Sender: jbondc@openmv.com X-Host-Fingerprint: 64.15.152.204 mail.ca.gdesolutions.com Received: from [64.15.152.204] ([64.15.152.204:62982] helo=mail.ca.gdesolutions.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4D/D8-16153-E71CC4A4 for ; Thu, 02 Jul 2009 10:17:36 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.ca.gdesolutions.com (Postfix) with ESMTP id 554F15C4C; Thu, 2 Jul 2009 10:17:32 -0400 (EDT) X-Virus-Scanned: amavisd-new at gdesolutions.com Received: from mail.ca.gdesolutions.com ([127.0.0.1]) by localhost (mail.ca.gdesolutions.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lrt1h2ZdFcci; Thu, 2 Jul 2009 10:17:32 -0400 (EDT) Received: from djbondc (modemcable083.208-56-74.mc.videotron.ca [74.56.208.83]) by mail.ca.gdesolutions.com (Postfix) with ESMTP id DA64B5C4B; Thu, 2 Jul 2009 10:17:31 -0400 (EDT) To: "'Paul Biggar'" , "'Ilia Alshanetsky'" Cc: "'PHP Internals'" , "'Derick Rethans'" , "'Stanislav Malyshev'" , "'Hannes Magnusson'" References: <85073B28-671D-4A8F-B2D6-5704E3E180BB@ilia.ws> In-Reply-To: Date: Thu, 2 Jul 2009 10:17:31 -0400 Message-ID: <004b01c9fb1f$d6a62360$83f26a20$@com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Acn7FChA05UQdqa8RliM1mtWS9btHAABztPQ Content-Language: en-ca Subject: RE: [PHP-DEV] Re: Flexible type hinting From: jbondc@openmv.com ("Jonathan Bond-Caron") On Thu Jul 2 08:53 AM, Paul Biggar wrote: > On Thu, Jul 2, 2009 at 1:43 PM, Ilia Alshanetsky wrote: > > > > On 2-Jul-09, at 4:45 AM, Paul Biggar wrote: > >> I think you might not have read what I suggested (it is different=20 > >> than the one I emailed to you privately). What you want is fully > supported. > >> If you must be passed an int, use the +int hint. > > > > I'd rather use -int, then +int and make people who want loose typing = > > do the extra bit, because native typing should be strict. >=20 > I think everyone wants their favourite to be default. I was eager to=20 > have the typing that's currently in the manual be the default, since=20 > that's what people are used to seeing. I suggested that strong type=20 > checks use +int exactly because that's different to what's in the=20 > manual, so there would be no confusion. >=20 > I'm really looking to get people to agree to the principle that we=20 > would like to be able to hint every signature without large changes to = > the manual, since we've been looking at it for years. >=20 From userland, I'm a big fan of this proposal / agree to the principle = although I'm not convinced that=20 function($quantity) function(int $quantity) function(+int $quantity) function(-int $quantity) looks appropriate... Userland Note: The "-int" semantics confuses me, I realize it would cast = null's etc... but is it really a requirement? Can it be dropped? function($quantity) function(int $quantity) paul's (S) casting function(int! $quantity) STRICT type --- seems appropriate for php, = follows CSS/web style '!important' To me, strict as default doesn't seem appropriate in php. But if it = does, this syntax could be interesting: function($quantity) function(int $quantity) STRICT type function(~int $quantity) paul's (S) casting Btw, really interesting discussions