Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:53842 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 9173 invoked from network); 11 Jul 2011 08:38:54 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Jul 2011 08:38:54 -0000 Authentication-Results: pb1.pair.com header.from=petercowburn@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=petercowburn@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.83.170 as permitted sender) X-PHP-List-Original-Sender: petercowburn@gmail.com X-Host-Fingerprint: 74.125.83.170 mail-pv0-f170.google.com Received: from [74.125.83.170] ([74.125.83.170:54076] helo=mail-pv0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 46/3C-41672-A96BA1E4 for ; Mon, 11 Jul 2011 04:38:51 -0400 Received: by pvh10 with SMTP id 10so2751579pvh.29 for ; Mon, 11 Jul 2011 01:38:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=3mgtMCoyA9uh5ExkxVJzv0H44CvEddQYcMI5QqJWctw=; b=RXxYRm8YyfBdhz2IHFiByRJcDg9mODKNOQzIeQw+3yzb0LJHzpm2emhOeEZTmcW8CJ ha8VBE9Xk1kXkoMpHMK86VLo6Lg7xX0WlfAvw/K5P6ynV9PFaGJpoXOMx9sSer5QNmz6 RMLQiV6jkZoZSm5aNNCXhhGXItFItZaiTx1vI= Received: by 10.68.64.72 with SMTP id m8mr6442190pbs.142.1310373527067; Mon, 11 Jul 2011 01:38:47 -0700 (PDT) MIME-Version: 1.0 Received: by 10.68.43.202 with HTTP; Mon, 11 Jul 2011 01:38:07 -0700 (PDT) In-Reply-To: References: <4DED3D5B.6030307@oracle.com> <4DEE782E.1020605@sugarcrm.com> <1307489981.23373.31.camel@guybrush> <1307527464.3635.395.camel@guybrush> <1310324547.4669.7.camel@guybrush> Date: Mon, 11 Jul 2011 09:38:07 +0100 Message-ID: To: Hannes Magnusson Cc: =?ISO-8859-1?Q?Johannes_Schl=FCter?= , Stas Malyshev , "Matthew Weier O'Phinney" , internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Callable type From: petercowburn@gmail.com (Peter Cowburn) 2011/7/11 Hannes Magnusson : > 2011/7/10 Johannes Schl=FCter : >> Hi, >> >> On Wed, 2011-06-08 at 12:04 +0200, Johannes Schl=FCter wrote: >>> >>> Having the behavior cleared I wonder how useful it is in practical >>> terms. A class type hint guarantees me I can do a specific call to >>> methods defined in the class/interface. The proposed type hint tells >>> me >>> I can call it in some way. It won't ensure that the signature is >>> compatible with what I expect. >>> >>> =A0 =A0 function foo(callable $cb) { >>> =A0 =A0 =A0 =A0 $cb(); >>> =A0 =A0 } >>> =A0 =A0 foo("strpos"); // This one in fact is illegal but won't be >>> prevented >>> >>> But maybe this doesn't matter as type hints purely serve documentation >>> (as E_RECOVERABLE are useless unless we make them Exceptions ...) >>> while >>> even for documentation purpose more information is needed. >> >> Any comments to this? - I didn't see an answer before the votes were >> opened. >> > > Voting is open on this? I don't think I ever had the time to integrate > all the Q&A from this thread to the RFC. The related vote is in the "Voting for 5.4 features" vote [1], which asks "do we want to include this feature in 5.4 release?" (and oddly, a preferred choice of callback/callable/neither). Voting on the RFC itself, the implementation details and such, will obviously be your call. Whether it makes sense to say "yes we want this in 5.4" before a more general vote on the RFC itself ("yes, we want this"), I'm not sure. [1] https://wiki.php.net/todo/php54/vote > > If you typehint on Closure, you don't know if it takes 0 or 10 > parameters either. > I don't think that is the point to know that either. > > -Hannes > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >