|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2012-10-27 23:52 UTC] will dot skates at ntlworld dot com
  [2013-08-06 08:04 UTC] yohgaki@php.net
 
-Status:      Open
+Status:      Closed
-Package:     Feature/Change Request
+Package:     *General Issues
-Assigned To:
+Assigned To: yohgaki
  [2013-08-06 08:04 UTC] yohgaki@php.net
 | |||||||||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 09:00:01 2025 UTC | 
Description: ------------ It becomes impossible to compare objects as soon as they have cross references. if an object A reference an object B that reference A it becomes impossible to compare objects with == or === operators. I understood your "reference" system and actualy I know that's not really a bug but an issue, but at least the === operator must deal with "already seen" objects. I just wonder if PHP5 will become a near to real object language or if that behavior will persist. Follow a basic example of Parent/Child object structure that can't be implemented in PHP4. I think that if it's impossible to work properly with instances, PHP5 will not ritch the rank of an OOP language despite all that is said about it. Best regards -Marc Reproduce code: --------------- <?PHP Class ParentObject { var $name; var $chidren; Function &ParentObject($name){ $this->name=$name; $this->children=array(); } Function addChild(&$child){ if(!isset($this->children[$child->name])){ $this->children[$child->name]=&$child; $child->setParent($this); } } } Class ChildObject { var $name; var $parent; Function &ChildObject($name){ $this->name=$name; $this->parent=null; } Function setParent(&$parent){ if($this->parent!==$parent){ if($this->parent!=null){ $this->parent->removeChild($this); } $this->parent=&$parent; if($parent!=null){ $parent->addChild($this); } } } } $p=&new ParentObject("parent"); $c=&new ChildObject("child"); $c->setParent($p); ?> Expected result: ---------------- something other than <b>Fatal error</b>: Nesting level too deep - recursive dependency? in <b>C:\Program Files\Apache Group\Apache2\htdocs\ngn2\test.php</b> on line <b>29</b><br /> Actual result: -------------- <b>Fatal error</b>: Nesting level too deep - recursive dependency? in <b>C:\Program Files\Apache Group\Apache2\htdocs\ngn2\test.php</b> on line <b>29</b><br />