Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:53806 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 69930 invoked from network); 10 Jul 2011 19:57:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Jul 2011 19:57:46 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 67.192.241.123 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 67.192.241.123 smtp123.dfw.emailsrvr.com Linux 2.6 Received: from [67.192.241.123] ([67.192.241.123:56469] helo=smtp123.dfw.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B6/F0-63663-9340A1E4 for ; Sun, 10 Jul 2011 15:57:46 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp12.relay.dfw1a.emailsrvr.com (SMTP Server) with ESMTP id 143023C00A0; Sun, 10 Jul 2011 15:57:43 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp12.relay.dfw1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id 25F623C009D; Sun, 10 Jul 2011 15:57:42 -0400 (EDT) Message-ID: <4E1A0435.1060503@sugarcrm.com> Date: Sun, 10 Jul 2011 12:57:41 -0700 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:5.0) Gecko/20110624 Thunderbird/5.0 MIME-Version: 1.0 To: =?UTF-8?B?Sm9oYW5uZXMgU2NobMO8dGVy?= CC: Hannes Magnusson , Matthew Weier O'Phinney , "internals@lists.php.net" References: <4DED3D5B.6030307@oracle.com> <4DEE782E.1020605@sugarcrm.com> <1307489981.23373.31.camel@guybrush> <1307527464.3635.395.camel@guybrush> <1310324547.4669.7.camel@guybrush> In-Reply-To: <1310324547.4669.7.camel@guybrush> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] Callable type From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! On 7/10/11 12:02 PM, Johannes Schlüter wrote: >> I can call it in some way. It won't ensure that the signature is >> compatible with what I expect. Well, it's like array type - you know it's an array but you can't know if it contains certain element that you expect, for example. As I'm not a big fan of strict typing in PHP anyway, I can't really defend this thing, but this is nothing new - other type restrictions don't guarantee you the code would work properly either, they only guarantee the type. >> >> 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 Indeed, E_RECOVERABLE is more or less useless - they are only marginally better than E_ERROR since error handler could be invoked on it. I do not know why people think E_RECOVERABLE makes anything better. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227