Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:23097 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 56147 invoked by uid 1010); 2 May 2006 22:49:05 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 56132 invoked from network); 2 May 2006 22:49:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 May 2006 22:49:05 -0000 X-PHP-List-Original-Sender: andrei@gravitonic.com X-Host-Fingerprint: 204.11.219.139 lerdorf.com Linux 2.5 (sometimes 2.4) (4) Received: from ([204.11.219.139:47178] helo=lerdorf.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 35/32-31513-FD1E7544 for ; Tue, 02 May 2006 18:49:03 -0400 Received: from [66.228.175.145] (borndress-lm.corp.yahoo.com [66.228.175.145]) (authenticated bits=0) by lerdorf.com (8.13.6/8.13.6/Debian-1) with ESMTP id k42Mmppr011106; Tue, 2 May 2006 15:48:52 -0700 In-Reply-To: <4456FF3D.7030607@lerdorf.com> References: <20060501161754.64020950@localhost.localdomain> <4456FF3D.7030607@lerdorf.com> Mime-Version: 1.0 (Apple Message framework v623) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-ID: Content-Transfer-Encoding: 7bit Cc: pierre.php@gmail.com, internals@lists.php.net Date: Tue, 2 May 2006 15:48:19 -0700 To: Rasmus Lerdorf X-Mailer: Apple Mail (2.623) Subject: Re: [PHP-DEV] ext/filter, add input_get_args, support of scalar or array result From: andrei@gravitonic.com (Andrei Zmievski) On May 1, 2006, at 11:42 PM, Rasmus Lerdorf wrote: > I think this looks ok. I have been trying to come up with a shorter > and cleaner syntax to specify these things, but so far I haven't come > up with anything I really like. The closest I have come is something > like this: > > $args = array( > 'product_id' => 'Enc', > 'component' => 'Int:Array:1-10', > 'versions' => 'Enc', > 'doesnotexist' => 'Int', > 'testscalar' => 'Int:Scalar', > 'testarray' => 'Int:Array' > ); You should just take Perl approach and use sigils [1]. :) $args = array( 'product_id' => '%', 'component' => 'i[1-10]', 'versions' => '%', 'doesnotexist' => 'i', 'testscalar' => 'i$', 'testarray' => 'i[]' ); -Andrei [1] http://en.wikipedia.org/wiki/Sigil_%28computer_programming%29