Migrating from 7.0 to 7.3 question

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

Not a direct answer to your issue, but this page should help identify what changed between 7.2 and 7.3. You might also need to check the changes between 7.1 and 7.2 an between 7.0 and 7.1.

You should also be aware that 7.3 is no longer supported and only receives security support for another 5 months - see here.

Thanks for the input. I was able to work through the issue and at the same time decided to go ahead and upgrade to 8.0 so thanks for that heads up also.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.