ID:               40204
 Updated by:       [EMAIL PROTECTED]
 Reported By:      frode at coretrek dot com
-Status:           Analyzed
+Status:           Closed
 Bug Type:         Documentation problem
 Operating System: Irrelevant
 PHP Version:      5.2
-Assigned To:      
+Assigned To:      colder
 New Comment:

This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation
better.

Warning removed.


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

[2007-01-23 09:18:15] [EMAIL PROTECTED]

This is complicated issue and _not_ recommended.

The engine still has problem working with complex arrays 
with references to it self and leaks tons of memory while 
doing so.

The example itself works as of 5.1 but still leaks and 
_can_ result in unexpected behavior.

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

[2007-01-23 08:38:14] frode at coretrek dot com

Description:
------------
Exmaple 21-3 "References with complex arrays" as available on
http://www.php.net/manual/en/language.references.whatdo.php is not
correct, at least not for PHP version 5.2.0.

The example claims to "not work as expected". But it does work as
expected (and contrary to the documented results). Also, even if the
example did "not work as expected", there is no explanation for why it
is not supposed to work, other than stating that complex arrays
"sometimes" (?!?) are copied.

Reproduce code:
---------------
<?php
// taken directly from Example 21-3
$top = array(
   'A' => array(),
   'B' => array(
       'B_b' => array(),
   ),
);

$top['A']['parent'] = &$top;
$top['B']['parent'] = &$top;
$top['B']['B_b']['data'] = 'test';
print_r($top['A']['parent']['B']['B_b']); // array()
?> 

Expected result:
----------------
According to the documentation:

array()



Actual result:
--------------
Array
(
    [data] => test
)
 



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


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

Reply via email to