php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49565 same arrays (with recursion) comparison don't result "equals"
Submitted: 2009-09-15 20:51 UTC Modified: 2009-09-16 07:33 UTC
From: pierb1971 at yahoo dot com Assigned:
Status: Not a bug Package: Arrays related
PHP Version: 5.3.0 OS: windows vista
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: pierb1971 at yahoo dot com
New email:
PHP Version: OS:

 

 [2009-09-15 20:51 UTC] pierb1971 at yahoo dot com
Description:
------------
When comparing (with "===") a reference of an array (which as recursion 
inside) with the original array itself, the result is not "equal" value 
but display recursion error

Reproduce code:
---------------
$z =& $GLOBALS;
if ($z === $GLOBALS) {
	print 'Equals';
} else {
	print 'Not equals';
}

Expected result:
----------------
Equals

Actual result:
--------------
Fatal error: Nesting level too deep - recursive dependency? in <file 
name> on line <line number>
Fatal error: Nesting level too deep - recursive dependency? in Unknown 
on line 0

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-09-16 07:33 UTC] jani@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 13 13:01:32 2025 UTC