ID:               17668
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
-Status:           Open
+Status:           Closed
-Bug Type:         Arrays related
+Bug Type:         Documentation problem
 Operating System: Win2K, FreeBSD
 PHP Version:      4.1.2
 New Comment:

This bug has been fixed in CVS. You can grab a snapshot of the
CVS version at http://snaps.php.net/. In case this was a documentation 
problem, the fix will show up soon at http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites.
Thank you for the report, and for helping us make PHP better.

Actually I think it's pretty clear


Previous Comments:
------------------------------------------------------------------------

[2002-06-09 14:53:11] [EMAIL PROTECTED]

$array[] = 1 is not the same as $array[$somenullvalue] = 1. This is not
intuitive and undocumented as far as I can tell.

Example:

--8<--

[armadillo:pgl]:~/public_html/test $ cat test.php
<?
#!/usr/local/bin/php -q
$array[] = 1;
$array[] = 2;

print_r($array);

unset($array);

$null = '';

$array[$null] = 3;
$array[$null] = 4;

print_r($array);
?>

--8<--

Prints:

--8<--

Array
(
    [0] => 1
    [1] => 2
)
Array
(
    [] => 4
)

--8<--

I would say this is a documentation problem, but I can't see how this
behaviour could be useful.

regards,

Peter Lowe.

------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=17668&edit=1

Reply via email to