List Info

Thread: note 78652 added to language.types.array




note 78652 added to language.types.array
user name
2007-10-21 22:45:40
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  -- h
ttps://master.php.net/note/delete/78652/integrated
Del: useless     -- http
s://master.php.net/note/delete/78652/useless
Del: bad code    -- htt
ps://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     -- http
s://master.php.net/note/delete/78652/in+docs
Del: other reasons-- https://mast
er.php.net/note/delete/78652
Reject      -- https://mast
er.php.net/note/reject/78652
Search      -- https://
master.php.net/manage/user-notes.php

-- 
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php


[1]

about | contact  Other archives ( Real Estate discussion Medical topics )