RE: [PHP-DEV] PHP 4.0 Bug #10149 Updated: array_pop reorders array keys

From: Date: Wed, 04 Apr 2001 06:01:07 +0000
Subject: RE: [PHP-DEV] PHP 4.0 Bug #10149 Updated: array_pop reorders array keys
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-50804@lists.php.net to get a copy of this message
I reopened 5226. Don't need two tickets for the same problem. -Chris -----Original Message----- From: spinn@spinnwebe.com [mailto:spinn@spinnwebe.com] Sent: Tuesday, 03 April, 2001 11-36 pM To: php-dev@lists.php.net Subject: [PHP-DEV] PHP 4.0 Bug #10149 Updated: array_pop reorders array keys ID: 10149 User Update by: spinn@spinnwebe.com Status: Closed Bug Type: Scripting Engine problem Description: array_pop reorders array keys I don't understand. I know it's a duplicate, but it wasn't fixed in 5226, either. Doesn't this make the array_x functions useless? Or, worse than useless, really, because I have to figure out which ones work and which don't (since I see array_pop works as expected), and keep a list of which ones to avoid, since functions can't be redefined, and I don't have the option of fixing them locally. Or, to put it another way: $a != array_pop(array_push($a, 1)) Again: this doesn't seem like a problem to you? Previous Comments: --------------------------------------------------------------------------- [2001-04-04 00:49:52] cnewbill@php.net Closing, duplicate of 5226. -Chris --------------------------------------------------------------------------- [2001-04-04 00:25:40] spinn@spinnwebe.com This is a repeat of 5226, but I couldn't add anything without a password, which I didn't have. In that bug, stas@cvs.php.net didn't understand the example that was given. What happens is this: if you have $a[5]="five"; $a[6]="six"; and then do array_pop($a), you now have $a[0]="five", not $a[5]="five", as I would expect. Despite not understanding the example, stas answered the question: that's the way the zend engine works. But you don't see that as a problem? --------------------------------------------------------------------------- Full Bug description available at: http://bugs.php.net/?id=10149 -- 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 (#50804) next »