Recent Changes - Search:



Related Projects

Powered by PmWiki



Can I send an object, such as a LinkedList which contains a reference to itself?

In PHP5, yes. In PHP4, no. Reason is that HessianPHP stores every object in an internal reference map and compares incoming objects to see if it is already been writen to the output stream, if it's present, only writes a reference to that object, this reduces the size of data sent to the network.

The problem arises when you have circular references, such as a linked list, where an object can contain a reference to itself. PHP4 can't handle comparison of objects with circular references because when objects are compared, PHP compares the value of every field and if one field value points to the object it will enter an infinite recursion cycle. Then PHP will throw a

Fatal error : Nesting level too deep - recursive dependency?.

So recomendation for now is, don't use circular references in PHP4. PHP5 is not affected by this behavior.

Edit - History - Print - Recent Changes - Search
Page last modified on December 21, 2005, at 02:24 AM

PmWiki can't process your request

Cannot acquire lockfile

We are sorry for any inconvenience.