Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:54458 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 12492 invoked from network); 8 Aug 2011 08:50:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Aug 2011 08:50:01 -0000 Authentication-Results: pb1.pair.com header.from=ekneuss@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ekneuss@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.161.42 as permitted sender) X-PHP-List-Original-Sender: ekneuss@gmail.com X-Host-Fingerprint: 209.85.161.42 mail-fx0-f42.google.com Received: from [209.85.161.42] ([209.85.161.42:53490] helo=mail-fx0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EA/41-04011-733AF3E4 for ; Mon, 08 Aug 2011 04:50:00 -0400 Received: by fxe23 with SMTP id 23so3022399fxe.29 for ; Mon, 08 Aug 2011 01:49:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=CAPgCTFsF3DiBvKaVLocgZzqqmGkZ82lFqDiYviPN0w=; b=b4epULt6ZAEWIIn0fDSLU6sBirwqefOQrwns5eeiBzTTdtGKfLi8GLcNNGfltoOKzj 6pst302u0PpwJpMcsHKOaNdXEGEpfZlInNbpFOsx4sOxEAjhMHRj2DLAk2EBf1SHs1EY F1bknhEqKfJdTyBeBfZChr4nRE8Km/q5JFPJM= MIME-Version: 1.0 Received: by 10.204.35.207 with SMTP id q15mr826112bkd.174.1312793396316; Mon, 08 Aug 2011 01:49:56 -0700 (PDT) Sender: ekneuss@gmail.com Received: by 10.204.49.17 with HTTP; Mon, 8 Aug 2011 01:49:56 -0700 (PDT) In-Reply-To: <1312789501.1485.3.camel@guybrush> References: <4E3F8D43.7000404@hoa-project.net> <1312789501.1485.3.camel@guybrush> Date: Mon, 8 Aug 2011 10:49:56 +0200 X-Google-Sender-Auth: 2HZsTYY1fA2cgK77NMHCBfh6Xk8 Message-ID: To: =?UTF-8?Q?Johannes_Schl=C3=BCter?= Cc: ivan.enderlin@hoa-project.net, internals@lists.php.net Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Add \Countable support to \Closure From: colder@php.net (Etienne Kneuss) Hello, 2011/8/8 Johannes Schl=C3=BCter : > On Mon, 2011-08-08 at 09:16 +0200, Ivan Enderlin @ Hoa wrote: >> Hi Internals, >> >> I would like to suggest you a new feature (for PHP5.4 or maybe next). >> The idea is to implement the \Countable interface into closures to >> easily count the arguments number. > > NO! > One could add a getParmNo() or such if really needed while I think > reflection is better (as it also gives parameter information about > required/optional and type "hints") > > Countable implies ArrayAccess or such. I don't believe Countable implies ArrayAccess, but I do think that Countable should only be implemented in cases where it is obvious what it will return, for example collections. In this case, count(Closure) is really not that explicit, I'd rather have an explicit method. Best, > > johannes > > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --=20 Etienne Kneuss http://www.colder.ch