Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:53202 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 38573 invoked from network); 8 Jun 2011 10:30:43 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Jun 2011 10:30:43 -0000 Authentication-Results: pb1.pair.com header.from=hannes.magnusson@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=hannes.magnusson@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.218.42 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: hannes.magnusson@gmail.com X-Host-Fingerprint: 209.85.218.42 mail-yi0-f42.google.com Received: from [209.85.218.42] ([209.85.218.42:49866] helo=mail-yi0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B1/BE-50253-84F4FED4 for ; Wed, 08 Jun 2011 06:30:41 -0400 Received: by yih10 with SMTP id 10so143754yih.29 for ; Wed, 08 Jun 2011 03:30:25 -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=Bs/cM5L6QNbddcfkj9Q2beIEUN2XW8N1KhK5L32RuZ0=; b=P62Q+FwoK48jIvM83Lg458HBkTHVmGXU85FLcP7A7s++JDUI58dmdF7VTrNffQNmQG KF76X7aZhcsrD+IKs2cglNlRd48tbCIPkBKHaPzUYYNtSep/qbxKYwbSlhKSrXYRUelw T9VGwAYfxlbTBlUjbucVRfGLA0hdWwAPNjTmA= 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=HsKdOfcYCLWSaCQ4j2NaSbYJd1nGDJdbrZGEOBSBt3pZaKfCR1EoBUI8S67iww9J7N qBRxaSrirXwOz8LoVysVwE1Xpq75coaZoFlS4d9Y2aMwoHqGGj1f6sm3OLq7b3eWkBN+ 5/c4sy19UNgMp7iUi5tVh7sv29nbkqxzNWOPk= MIME-Version: 1.0 Received: by 10.236.168.102 with SMTP id j66mr2191246yhl.41.1307529025392; Wed, 08 Jun 2011 03:30:25 -0700 (PDT) Received: by 10.146.210.3 with HTTP; Wed, 8 Jun 2011 03:30:25 -0700 (PDT) In-Reply-To: References: <4DED3D5B.6030307@oracle.com> <4DEE782E.1020605@sugarcrm.com> <7104F8AD-489E-4824-97AA-D9831FAB77AA@bitextender.com> <4DEE8ABB.8040503@sugarcrm.com> <7E4C6CB6-ED93-4BFC-87B8-94FDEF243896@bitextender.com> <17.29.50253.ACD8EED4@pb1.pair.com> <41.0E.50253.11B9EED4@pb1.pair.com> Date: Wed, 8 Jun 2011 12:30:25 +0200 Message-ID: To: RQuadling@gmail.com Cc: Alexey Shein , "Matthew Weier O'Phinney" , internals@lists.php.net Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Callable type From: hannes.magnusson@gmail.com (Hannes Magnusson) On Wed, Jun 8, 2011 at 12:27, Richard Quadling wrote: > On 8 June 2011 09:47, Alexey Shein wrote: >> 2011/6/8 Hannes Magnusson : >>> We have the situation in the docs that parameters declared as arrays >>> do not follow the typehinting rules, but parameters as class names do. >>> Re-using the callback from the docs could get confusing when >>> extensions start to typehint on it, but not the core.. >>> >>> I think there is a subtle difference between a callback, and a callable. >>> In javascript for example, callback is something that is executed on >>> certain events "onsuccess" is the typical example. >>> There is nothing that says the callable parameter gets executed as a >>> part of an event, and I think the default usecase would be to execute >>> it right away (f.e. filtering data). >>> >>> I think I would prefer callable, but I could live with either. >>> >> >> Wikipedia defines callback as "a reference to executable code, or a >> piece of executable code, that is passed as an argument to other >> code". So there's no "event" meaning put by default, it's just very >> often seen callback's usage in javascript. >> I just like "callback" term more :) > > An interesting issue here. > > Closures, classes with an __invoke method and strings containing > existing function names all pass is_callable() and can be called using > (). > > But, array('class', 'method') also passes is_callable, but isn't a callback. It is after Felipes recent commit introducing $array(); -Hannes