Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:39633 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 12649 invoked from network); 4 Aug 2008 16:37:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Aug 2008 16:37:38 -0000 Authentication-Results: pb1.pair.com header.from=stas@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=stas@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 212.25.124.163 as permitted sender) X-PHP-List-Original-Sender: stas@zend.com X-Host-Fingerprint: 212.25.124.163 il-gw1.zend.com Windows 2000 SP4, XP SP1 Received: from [212.25.124.163] ([212.25.124.163:58455] helo=il-gw1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F0/50-28228-15037984 for ; Mon, 04 Aug 2008 12:37:38 -0400 Received: from us-ex1.zend.com ([192.168.16.5]) by il-gw1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 4 Aug 2008 19:38:19 +0300 Received: from [192.168.17.27] ([192.168.17.27]) by us-ex1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 4 Aug 2008 09:38:15 -0700 Message-ID: <48973077.1070708@zend.com> Date: Mon, 04 Aug 2008 09:38:15 -0700 Organization: Zend Technologies User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Etienne Kneuss CC: PHP Internals List References: <48968C57.6070502@zend.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 04 Aug 2008 16:38:16.0007 (UTC) FILETIME=[7E7E1D70:01C8F650] Subject: Re: [PHP-DEV] __invoke concerns From: stas@zend.com (Stanislav Malyshev) Hi! > I'm not sure I understand what you mean? Either the interface covers > __invoke and "$obj instanceof Invokable" is a safe check to know if we > can $obj();, or it doesn't and we know nothing. Well, if you put it this way, it's not going to work. However, I thought there's middle ground - i.e. you can mark class as being "invokable" and barring some extremely forgetful programmer not using good tools, that'd mean it's safe to call since it was intended to be called. It's not 100% proof, but it gives you some structure. Note that "safety" is very relative here, since PHP is dynamic - as I explained in topics about typehints, typehint would not exactly make your code "safe" anyway - it would just shift the place where the trouble happens. -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com