Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:53096 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 12361 invoked from network); 6 Jun 2011 22:51:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Jun 2011 22:51:49 -0000 Authentication-Results: pb1.pair.com smtp.mail=chrisstocktonaz@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=chrisstocktonaz@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.173 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: chrisstocktonaz@gmail.com X-Host-Fingerprint: 209.85.212.173 mail-px0-f173.google.com Received: from [209.85.212.173] ([209.85.212.173:40737] helo=mail-px0-f173.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5F/66-23189-40A5DED4 for ; Mon, 06 Jun 2011 18:51:48 -0400 Received: by pxi16 with SMTP id 16so2880106pxi.18 for ; Mon, 06 Jun 2011 15:51:45 -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=a8ZHLu7AY+7AeI7m993lehP4V9SADQdey4iBGOAuVec=; b=q1H7jvHDh3NhhDaOI52Gq3JtCAdBHjstnCI+Ktk3QIyGTKyXHskD3f0viutJGijDhE 3WxxfQwk36ExFABEQz5+akog7OJ5zv6+Dci7E/iWb5EA00Z2AWKQa9L1LYlMFmkTwgYy tVkGDs9J2oLKRd1IOUdGTGt+vFZ2FpVpUbUgs= 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=oeH3saQvOs6BnZI1Owf5BdVatTNTX2n2OqPZgZM53vxruU5BlyIRsIuf6VfsNTnH31 H8nQmWl4UG5/FgAjElLFgXC07hr8Mu6UqcDIasmxq8yhq/CnXPZBDox04wZuR7M07PZN FUhZgIe538Nd3HE6xjp1ofLnK4Q5IL/+g6QWY= MIME-Version: 1.0 Received: by 10.68.22.2 with SMTP id z2mr2258890pbe.428.1307400705316; Mon, 06 Jun 2011 15:51:45 -0700 (PDT) Received: by 10.68.63.162 with HTTP; Mon, 6 Jun 2011 15:51:45 -0700 (PDT) In-Reply-To: References: Date: Mon, 6 Jun 2011 15:51:45 -0700 Message-ID: To: Hannes Magnusson Cc: PHP Development Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] Callable typehint From: chrisstocktonaz@gmail.com (Chris Stockton) Hello, On Mon, Jun 6, 2011 at 12:41 PM, Hannes Magnusson wrote: > Hi > > As quickly mentioned in the '$arr = array('Hello', 'world'); $arr();' > thread[1], we are hitting the need for a callable typehint. > This brings a clear and concise enhancement to PHP which I would benefit from .I have been watching our API provide more and more functions with callbacks as arguments and it would be nice to have a specific type for those to clean up the is_callable error handling. It is my opinion that comparing it to previous type hinting proposals is like comparing apples and oranges. I think it falls in align justification wise between Class Name and Array type hints. I.E. function test1(StdClass $p) .. function test2(Closure $p) ... <== doesn't this seem more justified then "Array" given the argument of previous type hinting proposals? function test3(Array $arr) +1 from me -Chris