Bug #51533 [Opn->Csd]: [recursive reference In Array] Nesting level too deep

From: Date: Mon, 08 Jun 2015 20:02:58 +0000
Subject: Bug #51533 [Opn->Csd]: [recursive reference In Array] Nesting level too deep
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-193213@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=51533&edit=1 ID: 51533 Updated by: cmb@php.net Reported by: neel dot basu dot z at gmail dot com Summary: [recursive reference In Array] Nesting level too deep -Status: Open +Status: Closed Type: Bug Package: Scripting Engine problem Operating System: Linux PHP Version: 5.3.2 -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: This issue has been fixed as of PHP 5.3.15 and PHP 5.4.5, see <http://3v4l.org/pCoou> and <http://3v4l.org/t5UWP>. Previous Comments: ------------------------------------------------------------------------ [2012-02-08 10:56:19] herb at bobbingwide dot com There is a comment in http://us.php.net/manual/en/function.is-array.php#98156 which suggests using casting to array to check if an array is actually an array. I was using this solution within a function that returns a default if the array index is not defined. It worked quite nicely until I tried to apply it to $GLOBALS and I got the Nesting level too deep. So I'm looking for another, highly efficient, solution that won't issue php notices for undefined indexes. Test script: <?php $GLOBALS == $GLOBALS; Expected result: Actual result: Fatal error: Nesting level too deep - recursive dependency? ------------------------------------------------------------------------ [2011-07-02 00:36:43] trefighter2334 at aol dot com Any word on this? I'm also experiencing this bug in both Ubuntu (Zend Server AND vanilla PHP) and Windows 7 (Zend Server). I guess I'm off to go find some hackish way to detect array recursion. ------------------------------------------------------------------------ [2010-04-11 19:38:45] neel dot basu dot z at gmail dot com **If It is not a Bug then Recursive Reference Detection is IMPOSSIBLE in PHP. cause spl_object_hash() doesn't work on array or scaler types. ------------------------------------------------------------------------ [2010-04-11 19:35:59] neel dot basu dot z at gmail dot com Description: ------------ When there is recursive reference in an array comparison yields Fatal Error. Both == and === operators yields the same. //------- If It is not a Bug then Recursion Detection is IMPOSSIBLE in PHP. cause spl_object_hash() doesn't work on array or scaler types. Test script: --------------- <?php error_reporting(255); ini_set('display_errors','On'); header('Content-Type: text/plain'); $a = array(); $a[0] = &$a; var_dump($a === $a[0]); var_dump($a == $a[0]); ?> Expected result: ---------------- boolean true or false Actual result: -------------- Fatal error: Nesting level too deep - recursive dependency? in /Server/http/php-bugs/nesting.php on line 8 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=51533&edit=1

« previous php.bugs (#193213) next »