Re: ext/filter, add input_get_args, support of scalar or array result

From: Date: Tue, 02 May 2006 22:48:19 +0000
Subject: Re: ext/filter, add input_get_args, support of scalar or array result
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-23097@lists.php.net to get a copy of this message
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

« previous php.internals (#23097) next »