Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:44656 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 59534 invoked from network); 2 Jul 2009 14:26:02 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Jul 2009 14:26:02 -0000 Authentication-Results: pb1.pair.com smtp.mail=paul.biggar@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=paul.biggar@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.227 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: paul.biggar@gmail.com X-Host-Fingerprint: 209.85.219.227 mail-ew0-f227.google.com Received: from [209.85.219.227] ([209.85.219.227:40345] helo=mail-ew0-f227.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B4/89-16153-A73CC4A4 for ; Thu, 02 Jul 2009 10:26:02 -0400 Received: by ewy27 with SMTP id 27so1924530ewy.23 for ; Thu, 02 Jul 2009 07:25:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=mkkCNf8ke9qBEBXs7ik36AJPrryBFPIyeps5I1eoJWY=; b=j1QMHud/eUcg6MvbchkspHnsko5L0bgLUQGQOVuduq7I+6ICUYBgp/WRVWIY3Xceih Tf+sbDn1J9tFL96UHFLNs8+8kFEnqeNsVzhqcvBd5mVsqB+JWRVI3VoNmK+K824s1TfT ovOsnDYpOF5NsPHyW0NmINSZ/Nsvg0buWtAiE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=Eudgs6aG0rwaW7zL3hlofh3V5rTjaARnlr/s6cAyKn1ZSUme6knFro8WOpV61Xw7ip wmVcTAn5gX0eFMZi3JJJta0+Qlu6VfpE3pm75v+zepxHlwwVhii4KCCVbIhg5PXVuj+p kAZC8vq81lo/GnMOyjipyB/GVuy88dI/cXcCM= MIME-Version: 1.0 Received: by 10.210.51.10 with SMTP id y10mr1014969eby.82.1246544759060; Thu, 02 Jul 2009 07:25:59 -0700 (PDT) In-Reply-To: <004b01c9fb1f$d6a62360$83f26a20$@com> References: <85073B28-671D-4A8F-B2D6-5704E3E180BB@ilia.ws> <004b01c9fb1f$d6a62360$83f26a20$@com> Date: Thu, 2 Jul 2009 15:25:39 +0100 Message-ID: To: Jonathan Bond-Caron Cc: Ilia Alshanetsky , PHP Internals , Derick Rethans , Stanislav Malyshev , Hannes Magnusson Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Re: Flexible type hinting From: paul.biggar@gmail.com (Paul Biggar) On Thu, Jul 2, 2009 at 3:17 PM, Jonathan Bond-Caron wrot= e: > From userland, I'm a big fan of this proposal / agree to the principle al= though I'm not convinced that > > 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? Yes, it looks off, doesnt it. I quite like ~int, which you suggested below, for the casting. It makes me think "this is kinda an int". > function($quantity) > function(int $quantity) =C2=A0paul's (S) casting > function(int! $quantity) STRICT type =C2=A0--- seems appropriate for php,= follows CSS/web style '!important' Yes, I like that too. > 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) =C2=A0STRICT type > function(~int $quantity) paul's (S) casting This is also a nice, internally-consistent syntax. If you had something for (H) in your suggestions, I'd be happier. We need to cast there too. Thanks, Paul --=20 Paul Biggar paul.biggar@gmail.com