Hi there,
I have just switched over to php5 and so have started making the variables in my classes private and then greating a public function which gets them.
Previously, I had this code in a page:
echo $movies_base->cert_array[$movie['cert']];
cert_array is a var in the movies base class, and it is an array.
Under php5, I have made cert_array private, and added a getter for it.
So now I have
echo $movies_base->get_cert_array()[$movie['cert']];
The above line is not valid code. My question is: is it possible to do what I need in one line or do I have to something like the following:
$cert_array = $movies_base->get_cert_array();
echo $cert_array[$movie['cert']];
Thanks
Colin