Re: zend_parse_parameters

From: Date: Sat, 08 Sep 2001 07:58:43 +0000
Subject: Re: zend_parse_parameters
References: 1 2 3  Groups: php.dev 
Request: Send a blank email to php-dev+get-65448@lists.php.net to get a copy of this message
At 09:33 PM 9/7/2001 +0100, Wez Furlong wrote:
On 07/09/01, "Andrei Zmievski" <andrei@ispi.net> wrote: If this is implemented (I think Andi may have some thoughts about this), Hopefully not bad thoughts!
I do have some bad thoughts about it. I'm worried that if we supply such an easy function to parse incoming hash table's people will start writing a lot of PHP functions which accept hash tables instead of regular argument lists. This is much slower and I think it's better to stay with the way functions are written today and not change the standard. There are very few functions which accept arrays as parameters and most of them are functions which act on Hashes so it makes sense. I think when you supply an API function like this which is very easy to use, it will start being misused quickly! What cases do you feel this is needed and are you sure regular argument lists aren't good enough? Andi
zend_parse_parameters_hash(HASH_OF(my_zval), "{s:firstname}|{s:lastname} {l:age}", &firstname, &firstname_len, &lastname, &lastname_len, &age); Yes - much better. I originally thought of something like this (a bit like the python dictionary syntax people have been talking about recently): "s%(firstname)|s%(lastname)l%(age)" But that is hard to read, so I thought of splitting it up. --Wez.


Thread (65 messages)

« previous php.dev (#65448) next »