|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-03-14 10:44 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 10:00:01 2025 UTC |
The problem is similar to var_dump(). var_dump() is fixed by Yasuo today but another one raised (see Bug#16065) var_export() has to handle recursive dependencies better and the fatal error is not an option. Here is the script: <?php $a=array(); $a[]=&$a; var_export($a); ?> and the ouput: bash-2.04$ ../php export.php X-Powered-By: PHP/4.3.0-dev Content-type: text/html array ( 0 => array ( 0 => array ( 0 => array ( PHP Fatal error: Nesting level too deep - recursive dependency? in /usr/samba/users/andy/412dev/php4-200203140300/te/export.php on line 4 <br /> <b>Fatal error</b>: Nesting level too deep - recursive dependency? in <b>/usr/samba/users/andy/412dev/php4-200203140300/te/export.php</b> on line <b>4</b><br /> Possible fix is another parameter(string) with var_export()-ed variable name - this will fix if the array has element which is reference to the array but will not handle this : <?php $a=array(1,2); $a[]=&$a; $b=array(&$a,3,4); var_export($a); ?> that crashes with output : array ( 0 => 1, 1 => 2, 2 => array ( 0 => 1, 1 => 2, 2 => array ( 0 => 1, 1 => 2, 2 => array ( 0 => 1, 1 => 2, 2 => array ( PHP Fatal error: Nesting level too deep - recursive dependency? in /usr/samba/users/andy/412dev/php4-200203140300/te/export.php on line 6 <br /> <b>Fatal error</b>: Nesting level too deep - recursive dependency? in <b>/usr/samba/users/andy/412dev/php4-200203140300/te/export.php</b> on line <b>6</b><br />