From: bens at effortlessis dot com
Operating system: All
PHP version: 4.3.2
PHP Bug Type: Feature/Change Request
Bug description: You cannot assign recursive array references.
Description:
------------
It does not seem possible to reduce the following two statements into a
single statement.
<?
$in=array(1=>'a', 2=>'b', 3=>array('aa', 'bb'));
$in[3]['cc']=&$in[3];
?>
I would suspect that this is the same or similar issue that causes the
following statement to fail:
<?
var_export($in);
?>
Reproduce code:
---------------
<?
$in=array(1=>'a', 2=>'b', 3=>array('aa', 'bb'));
$in[3]['cc']=&$in[3];
var_export($in);
?>
Expected result:
----------------
array(
1 => 'a',
2 => 'b',
3 => array(
0 => 'aa',
1 => 'bb',
'cc' => &$this->3,
)
);
/* Note: as I've said before, there doesn't seem to be a method to refer
to an element within the array being created at assignment time, I've used
object syntax instead */
Actual result:
--------------
array (
1 => 'a',
2 => 'b',
3 =>
array (
0 => 'aa',
1 => 'bb',
'cc' =>
array (
0 => 'aa',
1 => 'bb',
'cc' =>
array (
0 => 'aa',
1 => 'bb',
'cc' =>
array (
Fatal error: Nesting level too deep - recursive dependency? in
/home/bens/delete on line 4
--
Edit bug report at http://bugs.php.net/?id=26126&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=26126&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=26126&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=26126&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=26126&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=26126&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=26126&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=26126&r=support
Expected behavior: http://bugs.php.net/fix.php?id=26126&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=26126&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=26126&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=26126&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26126&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=26126&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=26126&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=26126&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=26126&r=float