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

From: Date: Tue, 30 Dec 2014 10:41:24 +0000
Subject: Req #26126 [Fbk->NoF]: You cannot assign recursive array references.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-189372@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:       php-bugs@lists.php.net
 Reported by:      bens at effortlessis dot com
 Summary:          You cannot assign recursive array references.
-Status:           Feedback
+Status:           No Feedback
 Type:             Feature/Change Request
 Package:          *General Issues
 Operating System: All
 PHP Version:      4.3.2
 Private report:   N

 New Comment:

No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.


Previous Comments:
------------------------------------------------------------------------
[2014-07-13 02:06:53] yohgaki@php.net

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?

------------------------------------------------------------------------
[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


Thread (3 messages)

« previous php.bugs (#189372) next »