title: PHP : Undefined property: stdClass
body: <p>I want to return a value from the below scripts :</p>
  
  <pre><code>$wsdl_url = 'http://srv.test/erProject/services/services?wsdl';
      $client = new SOAPClient($wsdl_url);
      $params = array(
          'IPADDR' =&gt; "111.12.13.14",
      );
      $return = $client-&gt;getUserInfo($params);
      print_r($return);
      echo $return-&gt;getUserInfo-&gt;expiredate;
  </code></pre>
  
  <p>print_r work and return:</p>
  
  <pre><code>stdClass Object
  (
      [return] =&gt; stdClass Object
          (
              [UserCredit] =&gt; stdClass Object
                  (
                      [expiredate] =&gt; 23-02-2018
                  )
  
              [resCode] =&gt; 1
          )
  
  )
  </code></pre>
  
  <p>but echo will return :</p>
  
  <blockquote>
    <p>PHP Notice:  Undefined property: stdClass::$UserCredit</p>
    
    <p>PHP Notice:  Trying to get property of non-object</p>
  </blockquote>
  
  <p>Thanks in advance</p>