Req #26126 [Opn->Fbk]: You cannot assign recursive array references.

From: Date: Sun, 13 Jul 2014 02:06:54 +0000
Subject: Req #26126 [Opn->Fbk]: You cannot assign recursive array references.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-186587@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=26126&edit=1 ID: 26126 Updated by: yohgaki@php.net Reported by: bens at effortlessis dot com Summary: You cannot assign recursive array references. -Status: Open +Status: Feedback Type: Feature/Change Request -Package: Feature/Change Request +Package: *General Issues Operating System: All PHP Version: 4.3.2 Block user comment: N Private report: N New Comment: Circular reference is supported and current var_export/var_dump detect recursion. It cannot be reduced to single statement still. What kind of syntax do you suggest for it? Previous Comments: ------------------------------------------------------------------------ [2003-11-04 18:59:37] bens at effortlessis dot com 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 this bug report at https://bugs.php.net/bug.php?id=26126&edit=1

« previous php.bugs (#186587) next »