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

From: Date: Tue, 27 Jun 2000 13:50:45 +0000
Subject: Re: Re: PHP 4.0 Bug #5226 Updated: arrayfields reorganized when using array_pop
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-22477@lists.php.net to get a copy of this message
AZ>> Well, both shift and pop use internal splice function because it's AZ>> fairly generic. I fear it's too generic. Like, you don't build you a new home and destroy the old one when you want to throw out garbage :) You don't need to copy entire array just to delete last element of it, probably. AZ>> > Anyway, I agree here that is should preserve keys and order. Though AZ>> > shift/unshift probably shouldn't. AZ>> AZ>> How about splice()? Well, tough question. I'd say to leave all them in place, but then shift doesn't work like splice... I'm confused. Any proposals? -- Stanislav Malyshev stas@zend.com +972-3-6139665

« previous php.dev (#22477) next »