title: assertEquals and assertTrue give different results for same variables
body: <p>As tested with phpunit:</p>
  
  <pre><code>$xml_1 = new SimpleXMLElement('&lt;name&gt;Bugs&lt;/name&gt;');
  $xml_2 = new SimpleXMLElement('&lt;name&gt;Bugs&lt;/name&gt;');
  
  $this-&gt;assertEquals($xml_1, $xml_2);    // Passes
  $this-&gt;assertTrue($xml_1==$xml_2);      // Fails
  </code></pre>
  
  <p>Um, what?</p>
  
  <p>EDIT:
  No, this is not a stupid question.  In Python:</p>
  
  <pre><code>import unittest
  class TestEqualityIdentity(unittest.TestCase):
  def test_equality(self):
      x   =   1
      y   =   1
      self.assertTrue(x==y)       # Passes
      self.assertEqual(x, y)      # Passes
  if __name__ == '__main__':
      unittest.main()
  </code></pre>
  
  <p>No reason PHP need behave like Python.  But, it isn't a stupid question in PHP either.</p>
  
  <pre><code>$x = 1;
  $y = 1;
  $this-&gt;assertEquals($x, $y);        //  Passes
  $this-&gt;assertTrue($x==$y);          //  Passes
  </code></pre>
  
  <p>EDIT 2
  Raymond's answer below is right, never mind that at this writing it's 3 votes down.</p>
  
  <p>FWIW, I needed an if test comparison of the text node values of two XML objects, and got it by casting them to strings.</p>
  
  <pre><code>$this-&gt;assertTrue((string) $xml_1== (string) $xml_2); // Passes, works in if test
  
  // Note that simply referring to a SimpleXMLElement _seems_ to give its 
  // text node.  
  
  $this-&gt;assertEquals($xml_1, 'Bugs');  // Passes
  
  // This seemed weird to me when I first saw it, and I can't 
  // say I like it any better now
  </code></pre>