title: read-only properties in PHP?
body: <p>Is there a way to make a read-only property of an object in PHP? I have an object with a couple arrays in it. I want to access them as I normally would an array </p>
  
  <pre><code>echo $objObject-&gt;arrArray[0];
  </code></pre>
  
  <p>But I don't want to be able to write to those arrays after they're constructed. It feels like a PITA to construct a local variable:</p>
  
  <pre><code>$arrArray = $objObject-&gt;getArray1();
  echo $arrArray[0];
  </code></pre>
  
  <p>And anyways, while it keeps the array in the object pristine, it doesn't prevent me from re-writing the local array variable.</p>