From:             php-bug at undoso dot info
Operating system: All
PHP version:      5.2.6
PHP Bug Type:     Arrays related
Bug description:  Inconsistent array loop

Description:
------------
When assigning into a cell of an array the array itself, the result is
incoherent. Since the assignation does not use reference, the array should
be copied and not create a magical structure that looks like an infinite
loop.
The worst is that the array seems impossible to browse using PHP since
there is no way to find that we are on a portion that we already visited,
or not at my knowing.

Reproduce code:
---------------
$arr = array();
$arr["loop"] $ arr;
print_r($arr);


Expected result:
----------------
Array
(
    [loop] => Array
        (
        )

)

Here is what the resulting print_r should looks like. Since no reference
is used, the array should be copied and only after that the loop cell
created.

Actual result:
--------------
The constructed array looks like that:
Array
(
    [loop] => Array
 *RECURSION*
)
wich is inconsistent.

By the way, f you find a way to browse this array in PHP and detect that a
recursion does exists, I want it because I just can't.

-- 
Edit bug report at http://bugs.php.net/?id=45109&edit=1
-- 
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=45109&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=45109&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=45109&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=45109&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=45109&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=45109&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=45109&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=45109&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=45109&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=45109&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=45109&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=45109&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=45109&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=45109&r=php4
Daylight Savings:             http://bugs.php.net/fix.php?id=45109&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=45109&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=45109&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=45109&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=45109&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=45109&r=mysqlcfg

Reply via email to