title: PHP setting optional arguments
body: <pre><code>class JSON_Response{
              private $ResponseCode = "RVN-775";
              private $ResponseDescription = "Unknown Request";
              private $ResponseOf = "Unknown";
              private $ResponsePayload = array("PayloadEmpty"-&gt;"Yes");
  
              function __construct(
                              $ResponseCode = null,
                              $ResponseDescription = null,
                              $ResponseOf = null,
                              $ResponsePayload = null,
                              )
          {
              $this-&gt;ResponseCode = $ResponseCode ? $ResponseCode : $this-&gt;ResponseCode;
              $this-&gt;ResponseDescription = $ResponseDescription ? $ResponseDescription : $this-&gt;ResponseDescription;
              $this-&gt;ResponseOf = $ResponseOf ? $ResponseOf : $this-&gt;ResponseOf;
              $this-&gt;ResponsePayload = $ResponsePayload ? $ResponsePayload : $this-&gt;ResponsePayload;
  
          }
      }
  </code></pre>
  
  <p>Is there any better way to write this?</p>
  
  <p>I want the class variables to be set if constructor gets parameters when object is created, if no parameters are given then I want the class variables to be default.</p>