title: Php If-Condition with Class Variables Not Working
body: <pre><code>class SignUp
  {
        var $pass;
        var $repass;
        var $eMail;
        var $userName;
  
      function __construct($p,$rep,$uName,$mail)
      {
          $this-&gt;pass     = $p;
          $this-&gt;repass   = $rep;
          $this-&gt;userName = $uName;
          $this-&gt;eMail    = $mail;
      }
  
      public function checkData() 
      {
          if ($this-&gt;pass != $this-&gt;repass)
          {
              return 2;
          }
       }
  }
  </code></pre>
  
  <p>This code doesn't seem to work and i don't know why .. It always returns 2 even when they are the same.</p>
  
  <p>Here's how i call the object</p>
  
  <pre><code>$ch = new SignUp($_POST['password'], $_POST['repassword'], $_POST['uname'], $_POST['emailID']);
  echo $ch-&gt;checkData();
  </code></pre>
  
  <p>Any help would be appreciated.</p>