Re: Re: PHP 4.0 Bug #5226 Updated: arrayfields reorganized when using array_pop

From: Date: Wed, 02 Aug 2000 13:38:41 +0000
Subject: Re: Re: PHP 4.0 Bug #5226 Updated: arrayfields reorganized when using array_pop
References: 1 2 3 4  Groups: php.dev 
Request: Send a blank email to php-dev+get-27443@lists.php.net to get a copy of this message
Oops, looks like I was reading mail from June and not July as I thought (: I still want you to consider my suggestion though. Stig On Wed, Aug 02, 2000 at 03:22:35PM +0200, Stig Venaas wrote: > On Tue, Jun 27, 2000 at 09:16:10AM -0500, Andrei Zmievski wrote: > > On Tue, 27 Jun 2000, Stanislav Malyshev wrote: > > > Yeah. So we should put on all splice-derived functions big red sign "It > > > wuld mess with all keys that look like numerics". I do not see what else > > > can we do now about it. > > > > Yes, and that's another reason to keep array_pop() using php_splice() - > > otherwise, like you pointed out, array_pop($a) array_splice($a, -1) > > would be inconsistent. > > So what? Then you can use the one that suits your needs. I would like > array_pop to change, it would make it quicker too. As I said earlier when > this came up, I think you can add an additional internal array_splice > function that can be used for array_pop, and perhaps have an extra parameter > to array_splice whether it should touch the keys. Then you could use > different internal array_splice depending on whether to touch the keys. > Maybe the internal array_splice might do both, but might be easier to have > two functions I think. > > My main point is that you can still do things in a generic way, and it > might be good to be able to choose whether to preserve keys when splicing. > > Stig > > -- > PHP Development Mailing List <http://www.php.net/> > To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net > For additional commands, e-mail: php-dev-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.dev (#27443) next »