Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:53097 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 13640 invoked from network); 6 Jun 2011 22:53:04 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Jun 2011 22:53:04 -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.210.42 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.210.42 mail-pz0-f42.google.com Received: from [209.85.210.42] ([209.85.210.42:64795] helo=mail-pz0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 28/B6-23189-F4A5DED4 for ; Mon, 06 Jun 2011 18:53:04 -0400 Received: by pzk37 with SMTP id 37so2302702pzk.29 for ; Mon, 06 Jun 2011 15:52:57 -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=JMXrzHjDRKUNthjBV2Fbni+TKzneH+H9YFGDawnCy0Q=; b=oAId6+W2HS7zmsTAJv7vm0ziuUlvfozliD1OmRaecQSAb5zMEPiTDj4qsdr9S+yMN0 AdBYTGgKSSes4UrXAcdMx/fPWZmCI9ZuBfNDww3sgK67i5majEOZOEluYvOdC2W63cbE PLrCK+V9bSI63L8fnEiWkR84H1n0tJUTlxaM8= 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=QNyQiif+yId+CetTT7cXuqWOm15nECaHpyaYhPvgI9dKjUrCQWKdqPPYysA7kSGEZn DT4lGaF1+giEvJwsnX2auyuqvNlfI7r8eyslskry1hpH5Zq3YrB8Or9/7ahjKFKkNnWd lrRfm4lePM+O00sdzBZhlqP69Abk+CiavNJJs= MIME-Version: 1.0 Received: by 10.68.39.72 with SMTP id n8mr2469446pbk.93.1307400777510; Mon, 06 Jun 2011 15:52:57 -0700 (PDT) Received: by 10.68.63.162 with HTTP; Mon, 6 Jun 2011 15:52:57 -0700 (PDT) In-Reply-To: References: Date: Mon, 6 Jun 2011 15:52:57 -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 3:51 PM, Chris Stockton wrote: > 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 > s/Closure/Callable/g