I have been using PHP for a number of years and have never had much of an issue upgrading. However, going to 7.3 which I would like to do I am finding that the passing of arguments between classes seems to be different.
For example, when I instantiate a class, I pass a variable called $content and then in the construct I I use it as $this->content = $content. Then when I call a method in the class I will set a variable like $cls->content[‘newvar’] = $thisval. And when I reference that from within the called class I simply refer to it as $this->content[‘newvar’] and all has been fine but now I get the message “Fatal error: Uncaught Error: Only variables can be passed by reference in”.
If I set the variable names specifically as $this->content[‘newvar’] = “” in the construct and pass it the same way it seems to work. What I am asking is am I correct in assuming that’s the way I need to do ti now?
I ask because that is a lot of work to change all that in the current code. If it has to be done, is there an easier way to do it? Thanks