note 78652 deleted from language.types.array by felipe
| From: | felipe@php.net | Date: | Sun, 16 Dec 2007 12:01:05 +0000 |
| Subject: | note 78652 deleted from language.types.array by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-133679@lists.php.net to get a copy of this message | ||
Note Submitter: Sezer Yalcin - pcdscorp.com
----
For advanced PHP users:
Here is what happens to keys when you use $a[] syntax:
$a[] = 1; // key is 0
$a[] = 1; // key is 1
So it goes from 0 to 2147483647
Then jumps to -2147483648 and goes up to 0 again.
(if you do $a[] for 4294967296 times)
When its 0, it starts over and does 0, 1, 2 ...
I needed to investigate this in order to avoid any instability. Our spam filter MAHAN does this $a[]
millions of times but removes completed elements so that there is no memory outage.