Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:53802 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 60649 invoked from network); 10 Jul 2011 19:02:56 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Jul 2011 19:02:56 -0000 Authentication-Results: pb1.pair.com smtp.mail=johannes@schlueters.de; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=johannes@schlueters.de; sender-id=unknown Received-SPF: error (pb1.pair.com: domain schlueters.de from 217.114.211.66 cause and error) X-PHP-List-Original-Sender: johannes@schlueters.de X-Host-Fingerprint: 217.114.211.66 config.schlueters.de Received: from [217.114.211.66] ([217.114.211.66:35781] helo=config.schlueters.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 13/30-56983-E57F91E4 for ; Sun, 10 Jul 2011 15:02:55 -0400 Received: from [192.168.2.230] (ppp-93-104-55-192.dynamic.mnet-online.de [93.104.55.192]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by config.schlueters.de (Postfix) with ESMTPSA id AA83375133; Sun, 10 Jul 2011 21:02:50 +0200 (CEST) To: Hannes Magnusson Cc: Stas Malyshev , Matthew Weier O'Phinney , internals@lists.php.net In-Reply-To: <1307527464.3635.395.camel@guybrush> References: <4DED3D5B.6030307@oracle.com> <4DEE782E.1020605@sugarcrm.com> <1307489981.23373.31.camel@guybrush> <1307527464.3635.395.camel@guybrush> Content-Type: text/plain; charset="UTF-8" Date: Sun, 10 Jul 2011 21:02:27 +0200 Message-ID: <1310324547.4669.7.camel@guybrush> Mime-Version: 1.0 X-Mailer: Evolution 2.30.2 Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] Callable type From: johannes@schlueters.de (Johannes =?ISO-8859-1?Q?Schl=FCter?=) Hi, On Wed, 2011-06-08 at 12:04 +0200, Johannes Schlüter 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. > > function foo(callable $cb) { > $cb(); > } > 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. johannes