Re: [PATCH] array_fill: Allow an array to specify keys

From: Date: Sat, 15 Jul 2006 13:19:10 +0000
Subject: Re: [PATCH] array_fill: Allow an array to specify keys
References: 1 2 3 4 5 6 7 8 9 10 11 12  Groups: php.internals 
Request: Send a blank email to internals+get-24395@lists.php.net to get a copy of this message
Hello Matt, Saturday, July 15, 2006, 2:45:16 PM, you wrote: > Hi Marcus, > ----- Original Message ----- > From: "Marcus Boerger" >> Hello Matt, >> >> thanks for the update >> >> best regards >> marcus > No problem, but... > HEAD looks good now (meaning how you guys want it), but there's an issue > with 5.2 -- fill and fill_keys will handle "val" passed by reference > differently. Either fill_keys needs > if (PZVAL_IS_REF(...)) { > SEPARATE_ZVAL(...); > } > added or that part removed from array_fill to make them behave the same, > right? (This is just 5.2, HEAD's fine.) Well the code is equal now. > Also, again, with both branches, if you're allowing array_fill_keys to > return an empty array (which I support), shouldn't array_fill be changed to > do the same? > You want consistency where it's expected, right? :-) Hey, well yeah. I had to read the code more than once to spot how it works in detail and do not particular like the limitation in array_fill(). I rather prefer to change that or live with the inconstistency here as the functions more or less do something related but work completley different and have a very different signature, don't they? Best regards, Marcus

« previous php.internals (#24395) next »