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
So recomendation for now is, don't use circular references in PHP4. PHP5 is not affected by this behavior.