Re: consistent way to handle structs
| From: | Andrei Zmievski | Date: | Fri, 11 Jan 2002 14:29:23 +0000 |
| Subject: | Re: consistent way to handle structs | ||
| References: | 1 2 3 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-76650@lists.php.net to get a copy of this message | ||
On Fri, 11 Jan 2002, Markus Fischer wrote:
> I'm for (+1) assoc return values.
>
> I think the code which is used to handle it is more verbose
> then ( $day = $assoc['day']; and not $day = $arr[0]; or
> whatever) and it also helps debugging because you can just do
> a print_r() on the return type.
>
>
> If we start to agree on assoc params we should also think of
> new functions to more easily parse them to expected variable
> types
>
> zend_parse_parameters_hash(hashtable TSRMLS_CC,
> " key1:type1,
> |optional_key2:type2",
> &var1, &var2);
>
> Ok, don't sue me, its just an idea how to simplify those kind
> of param-parsings. Zak and I were also discussing about such
> a way of parsing more optional argument after his recent
> mysql propose.
>
> Maybe Andrei has an idea too?
Hey, I suggested this idea to Andi when I was writing parse-parameters
stuff, but it didn't sit well with him because it would encourage people
to pass slow arrays around and all that, he said.
-Andrei
* If it's never finished, you can't prove it doesn't work. *