Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:53176 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 81869 invoked from network); 7 Jun 2011 19:12:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Jun 2011 19:12:52 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 207.97.245.133 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 207.97.245.133 smtp133.iad.emailsrvr.com Linux 2.6 Received: from [207.97.245.133] ([207.97.245.133:54134] helo=smtp133.iad.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8B/26-50253-2387EED4 for ; Tue, 07 Jun 2011 15:12:52 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp53.relay.iad1a.emailsrvr.com (SMTP Server) with ESMTP id C8BEA5848F; Tue, 7 Jun 2011 15:12:47 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp53.relay.iad1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id B33AA58215; Tue, 7 Jun 2011 15:12:46 -0400 (EDT) Message-ID: <4DEE782E.1020605@sugarcrm.com> Date: Tue, 07 Jun 2011 12:12:46 -0700 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: Matthew Weier O'Phinney CC: "internals@lists.php.net" References: <4DED3D5B.6030307@oracle.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Callable type From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > https://wiki.php.net/rfc/callable It is good there's an RFC. However it seems to lack code examples. I understand it may be obvious to the proposers how it looks like, but it'd be nice to have the actual example there as it is done nearly everywhere else. The patch introduces new zval type IS_CALLABLE but zval functions weren't updated for it - IIRC at least dtor may end up being called on IS_CALLABLE value produced in the parser. Note also that this pseudo-type is called "callback" in all of our documentation, which means we have now documentation that says: bool array_walk ( array &$array , callback $funcname [, mixed $userdata ] ) and type check that says "callable". Also, it is not clear what would happen if this type check is made against method which is not accessible (e.g. private out of scope). Would it say that the argument is invalid (which would be really confusing since it'd say something like "callable expected, array given" which it technically correct but doesn't explain why this array is not callable) or would allow it? If not, then zend_is_callable error information should be used and displayed. And the tests need to cover these cases, along with __call and __callStatic. For me personally it makes zero sense that having just removed strict typing we are introducing it back through back door, but if everybody likes it so be it. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227