note 78652 added to language.types.array
| From: | SezerYalcin-pcdscorp dot com at osu1 dot php dot net | Date: | Mon, 22 Oct 2007 03:45:40 +0000 |
| Subject: | note 78652 added to language.types.array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-131616@lists.php.net to get a copy of this message | ||
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.
----
Server IP: 67.15.241.2
Probable Submitter: 76.118.32.22
----
Manual Page -- http://www.php.net/manual/en/language.types.array.php
Edit -- https://master.php.net/note/edit/78652
Del: integrated -- https://master.php.net/note/delete/78652/integrated
Del: useless -- https://master.php.net/note/delete/78652/useless
Del: bad code -- https://master.php.net/note/delete/78652/bad+code
Del: spam -- https://master.php.net/note/delete/78652/spam
Del: non-english -- https://master.php.net/note/delete/78652/non-english
Del: in docs -- https://master.php.net/note/delete/78652/in+docs
Del: other reasons-- https://master.php.net/note/delete/78652
Reject -- https://master.php.net/note/reject/78652
Search -- https://master.php.net/manage/user-notes.php