| 
	
 | 
 Posted by denisbytezone on 03/01/07 02:28 
I've hit two problems recently that strike me as major issues. 
Firstly, if you compare two objects for equality, and there is some 
recursion involved internal to the object's structure, then PHP gives 
an error. 
 
Consider this: 
 
$blob1 = new Blob (); 
$blob2 = new Blob (); 
 
$blob1->child = $blob2; 
$blob2->child = $blob1; 
 
$blob1 === $blob2 ? print 'equal' : print 'not equal';		// works 
$blob1 ==  $blob2 ? print 'equal' : print 'not equal';		// fails 
 
Class Blob 
{ 
	public $child; 
} 
 
I reported this as a bug, and was told "that's how PHP works - not a 
bug" 
 
Secondly, today I find out that using session_start() is a good way to 
pass objects from web page to page, UNLESS they use SimpleXML. As they 
say, WTF? 
 
I've found that this was also reported as a bug (by someone else), and 
they received the same response. I find it very difficult to continue 
with this language, not knowing what weirdo error is going to crop up 
next and then to be told "It's supposed to do that" 
 
Is there a workaround to the second problem? How does one share 
objects between pages when using SimpleXML?
 
  
Navigation:
[Reply to this message] 
 |