Date: 02/28/03
- Next message: mccarthy36 at earthlink dot net: "[PHP-DOC] #22476 [NEW]: session.save_path documentation is misleading"
- Previous message: moriyoshi <email protected>: "[PHP-DOC] #22331 [Opn->Asn]: mbstring configuration variables are marked PHP_INI_ALL, but this is false."
- Next in thread: Gabor Hojtsy: "Re: [PHP-DOC] Inconsistency in Array section of manual"
- Reply: Gabor Hojtsy: "Re: [PHP-DOC] Inconsistency in Array section of manual"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
www.php.net/manual/en/language.types.array.php is inconsistent on the issue
of integer keys for arrays.
Right at the start we have:
------------------------------------
array( [key =>] value
, ...
)
// key is either string or nonnegative integer
// value can be anything
-------------------------------------
which to my mind rules out negative integers as keys. as someone well versed
in traditional arrays that sees reasonable!
However, later we have:
--------------------------------------------
If you omit a key, the maximum of the integer-indices is taken, and the new
key will be that maximum + 1. As integers can be negative, this is also true
for negative indices. Having e.g. the highest index being -6 will result
in -5 being the new key. If no integer-indices exist yet, the key will be 0
(zero). If you specify a key that already has a value assigned to it, that
value will be overwritten.
-----------------------------------------------
which implies that negative integers are ok as a key!
Which is correct?
______________________________________
Keith Underdown
Q Consultancy
8A New Rowley Rd
DUDLEY
DY2 8AS
+44 1384 231180
+44 7798 934782
-- PHP Documentation Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
- Next message: mccarthy36 at earthlink dot net: "[PHP-DOC] #22476 [NEW]: session.save_path documentation is misleading"
- Previous message: moriyoshi <email protected>: "[PHP-DOC] #22331 [Opn->Asn]: mbstring configuration variables are marked PHP_INI_ALL, but this is false."
- Next in thread: Gabor Hojtsy: "Re: [PHP-DOC] Inconsistency in Array section of manual"
- Reply: Gabor Hojtsy: "Re: [PHP-DOC] Inconsistency in Array section of manual"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

