Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:53182 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 94827 invoked from network); 7 Jun 2011 20:37:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Jun 2011 20:37:19 -0000 Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.170 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.213.170 mail-yx0-f170.google.com Received: from [209.85.213.170] ([209.85.213.170:46534] helo=mail-yx0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3F/38-50253-EFB8EED4 for ; Tue, 07 Jun 2011 16:37:19 -0400 Received: by yxn35 with SMTP id 35so1907370yxn.29 for ; Tue, 07 Jun 2011 13:37:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=0EgEm86xoQfkhK50aZpvVfglC9TWCtztsH6rsNqkK0k=; b=lEyrNa9R1SpXRttHTBU1c/06Y80e9FSCgaTJNB0AT11uWKXvAgXoT0NecDFyl4sBPK SPsUbLvARonRaClD88NyxdTzGsF9S6Alfo+A24vFzgR+M/QvHb4ndpXnCpvOI4cOFJVM LW9CFNQs+D2e3XqiGvAm2C5YpeqDV6bpi4WNg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=df3SK8uPapvvC/AW8WrGaBp4l54OuvVjxR7YXvVIu7yESIV+qsw8GZcHA4EPUCuMHo DI4xYiOZ5Iw000Dq04jGWIkDQfamTbWwj/qQuSZmZ0KTA5kGnBIrNXJm8vJYsnzs70GZ LH61VJh6cCemrHQUoG9sQuFV1UizokKcz+wXI= MIME-Version: 1.0 Received: by 10.146.26.23 with SMTP id 23mr4024706yaz.33.1307479036155; Tue, 07 Jun 2011 13:37:16 -0700 (PDT) Received: by 10.147.168.18 with HTTP; Tue, 7 Jun 2011 13:37:16 -0700 (PDT) In-Reply-To: <4DEE782E.1020605@sugarcrm.com> References: <4DED3D5B.6030307@oracle.com> <4DEE782E.1020605@sugarcrm.com> Date: Tue, 7 Jun 2011 22:37:16 +0200 Message-ID: To: Stas Malyshev Cc: "Matthew Weier O'Phinney" , "internals@lists.php.net" Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] Callable type From: pierre.php@gmail.com (Pierre Joye) hi Stas, I have to say that we should apply our upcoming voting rule here as well. If we don't, pls count -1 from here anyway. Cheers, On Tue, Jun 7, 2011 at 9:12 PM, Stas Malyshev wrote: > 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 > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Pierre @pierrejoye | http://blog.thepimp.net | http://www.libgd.org