Bug #18140 Updated: Array key -1 can crash PHP

From: Date: Wed, 03 Jul 2002 16:35:00 +0000
Subject: Bug #18140 Updated: Array key -1 can crash PHP
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-13003@lists.php.net to get a copy of this message
ID: 18140 Updated by: sander@php.net Reported By: carl@thep.lu.se -Status: Open +Status: Feedback Bug Type: Arrays related Operating System: Linux PHP Version: 4.2.1 New Comment: Thank you for this bug report. To properly diagnose the problem, we need a backtrace to see what is happening behind the scenes. To find out how to generate a backtrace, please read http://bugs.php.net/bugs-generating-backtrace.php Once you have generated a backtrace, please submit it to this bug report and change the status back to "Open". Thank you for helping us make PHP better. Can't reproduce with latest CVS. Can you try the CVS version and generate a backtrace if possible? Previous Comments: ------------------------------------------------------------------------ [2002-07-03 11:50:10] carl@thep.lu.se If the last key of an array with at least 2 elements is -1, adding new elements with [] (or array_push) crashes PHP. Here is the simplest example I could create: $arr = array(0=>0,-1=>0); $arr[] = 0; I haven't tested with the CVS version. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=18140&edit=1

« previous php.bugs (#13003) next »