Class returning object confusion
<p>I've been asked to create a class that does some stuff, and then returns an object with read only properties.. Now I've created the class and I've got everything working 100%, however I'm confused when they say to 'return an object with read only properties'..</p>

<p>This is the outline of my php file which contains the class and some extra lines calling it etc:</p>

<pre><code>class Book(){
 protected $self = array();
 function __construct{
  //do processing and build the array
 }

 function getAttributes(){
  return $this-&gt;self; //return the protected array (for reading)
 }
}

$book = new Book();

print_r($book-&gt;getAttributes());
</code></pre>

<p>Can someone please help me with returning an object or something?</p>

<p>Thanks</p>
